时间:2021-07-01 10:21:17 帮助过:9人阅读
function newtripos($str,$findstr,$count,$off=0){
$pos=stripos($str,$findstr,$off);
$count--;
if($count>0 && $pos!=false){
$pos=newtripos($str,$findstr,$count,$pos+1);
}else{
var_dump($pos);
return $pos;
}
}
$a="456123456455654466";
$b=newtripos($a,'6',4);
var_dump($b);
?>
function newtripos($str,$findstr,$count,$off=0){
$pos=stripos($str,$findstr,$off);
$count--;
if($count>0 && $pos!=false){
$pos=newtripos($str,$findstr,$count,$pos+1);
}
return $pos;
}
if($count>0 && $pos!=false){
$pos=newtripos($str,$findstr,$count,$pos+1);
return null;
}else{
var_dump($pos);
return $pos;
}
}
?>
if($count>0 && $pos!=false){
$pos=newtripos($str,$findstr,$count,$pos+1);
return $pos;
}else{
var_dump($pos);
return $pos;
}
}
?>