2012-01-21 37 views
-2

顯示我的錯誤:錯誤:警告:strpos()[function.strpos]:偏移不包含在字符串

警告:strpos()[function.strpos]:偏移不包含在字符串

代碼是

function trimSearchURL($URL, $Pos, $end = '&') 
{ 
    if ($Pos) { 
     $nEndPos = strpos($URL, $end, $Pos); 
     if ($nEndPos === false) { 
      $URL = substr($URL, $Pos); 
     } else { 
      $URL = substr($URL, $Pos, $nEndPos - $Pos); 
     } 
    } 
    return $URL; 
} 
+3

然後做一些基本的調試。 「Pos」有什麼價值? –

回答

3

$波什似乎比在$ URL字符串大長

$nEndPos = strpos($URL, $end, $Pos) 
相關問題