Okay so I've been going over the PHP manual doing test applications as I go along and I came across this issue that honestly totally threw me. I figured it out (after 20 minutes of thinking the world was about to end) so thought I'd post the code and although some experts will simply shake their head others will hopefully see the funny side.
So I'm running a simple script iterating through two arrays and outputting some text. Code is below.
<?php
for($i = 0;$i < 100;$i++){
for($k =0; $k < 100;$k++){
echo "$i and $k";
}
}
?>
I'd have expect to get something along the lines of 00 and 01 and 02 and 03 etc... but as you have probably guessed that's not what I was getting. Instead I was getting 0 and 00 and 10 and 20 and 30.
Anyway figured it all out now and I'm hanging my head in shame.