Thanks, I will try that when I get a chance.
I think what I had was $array[$i] in a while loop so $i gets incremented by one each time until the end of the array. I can't get to the code right now to check.