-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;
}
然後做一些基本的調試。 「Pos」有什麼價值? –