我有一個使用strpos()方法,並在一個網站上,我得到這個錯誤插件警告:strpos()[function.strpos]:空分隔符
Warning: strpos() [function.strpos]: Empty delimiter. in /home/mysite/public_html/wp-includes/compat.php on line 55
任何想法的可能原因這可能是?
從compat.php
if (!function_exists('stripos')) {
function stripos($haystack, $needle, $offset = 0) {
return strpos(strtolower($haystack), strtolower($needle), $offset);
}
}
我的代碼片段...
function myFunction($thePost)
{
$theContent = $thePost->post_content;
$myVar1 = array();
preg_match_all('/<a\s[^>]*href=\"([^\"]*)\"[^>]*>(.*)<\/a>/siU',$theContent,$myVar1);
$myVar2 = 0;
foreach ($myVar1[1] as $myVar3)
{
$myVar4 = $myVar1[2][$myVar2];
$myVar5 = FALSE;
$myVar6 = get_bloginfo('wpurl');
$myVar7 = str_replace('http://www.','',$myVar3);
$myVar7 = str_replace('http://','',$myVar7);
$myVar8 = str_replace('http://www.','',$myVar6);
$myVar8 = str_replace('http://','',$myVar8);
if (strpos($myVar3,'http://')!==0 || strpos($myVar7,$myVar8)===0) return TRUE;
$myVar2++;
}
return FALSE;
}
請發佈您的php代碼,我們無法猜測您對此功能的使用 – 2010-12-07 04:12:12
並且您是否已經在/home/mysite/public_html/wp-includes/compat.php的第55行找到了_looked_?我的心理調試技能與Raymond Chen的不匹配,但即使我可以找出這可能是最好的開始:-) – paxdiablo 2010-12-07 04:12:50