I thought if using explode too, but I decided there had to be a less memoryt-hungry solution :-)
strpos() will find an occurence of a string inside another string, and you can tell it where to start searching.
so:
strpos('foobar', 'b', 2)
will return the position of 'b' in 'foobar', and start looking at character 3 (position 2=character 3)
it will return 3, because the 'b' is in position 3 of the string (fourth character)
Small note about your code:
for($arrayLoop="0";
$arrayLoop is an integer, so no quotes around the zero!