如何排除PHP Fatal error: Uncaught Error: Call to undefined function split()
在更換wordPress改使用php7後,在前端及後端編輯器時又發生問題啦,又要debug 了,查了一下出現了「 Fatal error: Uncaught Error: Call to undefined function split() 」錯誤
查了一下,原來是php7 已停用 split(),所以就報錯啦,而這問題出錯在我安裝的sociable外掛上,最新版都無法排除看來這套件也很久沒再更新了,先排除此問題之後再來看看是否要更換此外掛
找了一下資料,目前可以使用 preg_split() 或 explode() 來替代split()
1 2 3 4 5 6 7 8 9 10 | if ( count (<strong> explode </strong>( "Counter" , $sitename ))>1){ //if (count(<strong>split</strong>("Counter",$sitename))>1){ $link .= $href ; } else { $link .= '<a title="' . $sitename . '" class="' . $sociable_options [ 'icon_option' ]. '_' . $sociable_options [ 'icon_size' ]. '" style="' . $style . '" rel="nofollow" ' . $target . ' href="' . $href . '">' . "" . '</a></li>' ; } |
照著上面這樣改,就可以啦。
參考資料:
近期留言