Find all occurences of a string
by Rekha[ Edit ] 2010-03-12 11:34:37
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;
}
}