Jump to content

[SOLVED] While nested in a for loop problem


mikedj

Recommended Posts

Why won't this For loop do more than one iteration when the While loop is nested inside?  Each loop works fine independently, but when I nest them, I only get the first iteration of the for loop.

 

Thanks,

Mike

 

 

<?php
$i=0;
for ($j=0;$j<2;$j++) {
	while ($i<10) {
		echo "\$j = " . $j . "<br/>";
		$i++;
	}
}
?>

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.