Any help much appreciated.
function strpos_array($haystack, $needle)
{
$kill = 0; // Kills while loop when changed
$offset = 0; // Offset for strpos()
$i = 0; // Counter, not iterator
while ($kill === 0)
{
$i++;
$result = strpos($haystack, $needle, $offset);
if ($result === FALSE)
{ // If result is false (no more instances found), kill the while loop
$kill = 1;
} else {
$array[$i] = $result; // Set array
$offset = $result + 1; // Offset is set 1 character after previous occurence
}
}
return $array;
}