Code: Select all
for ($i = 0; $i < 5; $i++){
if ($i == 2)
continue;
print "$i<br />";
}
0
1
3
4
but the "continue" definition in the php manual(http://www.php.net/manual/en/control-st ... ntinue.php) tells that the control will check the condition whenever it encounters the "continue" statement. According that definition control should check the condition then the program should output like
0
1
and $i value is 2(since control should go to check the condition) forever then the loop should become infinite...
But i thought that according for loop definition control will go to count variable and increments the $i value to 3 and checks the condition that is way it may give the result like
0
1
3
4
am I right? please clarify that the "continue" definition regarding for loop....
Thank you.