Find all occurences of a string - PHP Views : 281
Tagged in : PHP
Send mail vote down 0 vote down 1
Function to find all occurences of a string

function find_occurences($string, $find) {
if (strpos(strtolower($string), strtolower($find)) !== FALSE) {
$pos = -1;
for ($i=0; $i $pos = strpos(strtolower($string), strtolower($find), $pos+1);
$positionarray[] = $pos;
}

return $positionarray;
}
else {
return FALSE;
}

}
By - Rekha, On - 2010-03-12




    Login to add Comments .