There's something wrong in your description of the problem. The loop cannot fail so badly. For instance, the following
PHP
code
for ($i=0; $i<10; $i++)
{
$a = "value = '$i'";
echo $a . "\n";
}
produces the output
value = '0'
value = '1'
value = '2'
value = '3'
value = '4'
value = '5'
value = '6'
value = '7'
value = '8'
value = '9'