日期:2014-05-17 浏览次数:20468 次
<?php
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;
}
<?php
if($count>0 && $pos!=false){
$pos=newtripos($str,$findstr,$count,$pos+1);
return null;
}else{
var_dump($pos);
return $pos;
}
}
?>
<?php
if($count>0 && $pos!=false){
$pos=newtripos($str,$findstr,$count,$pos+1);
return $pos;
}else{
var_dump($pos);
return $pos;
}
}
?>