I meant to add, if you do have something like $wordcount=count($normalSearchSplit), you can use an ordinary loop, like
for($i=0; $i<$wordcount; ++$i)
{}
Which is exactly equivalent to
$i=0;
while($i<$wordcount)
{
...
$i++;
}
But then the bits that control your loop end up getting scattered all over the place.