Is there anything or keawords in PHP from which I can break or continue from a LOOP in PHP??
in C
for(i=0;i<=100;i++){
statement1....;
statement2....;
if(condition1)
break;
else
continue;
statement3....;
statement4....;
statement5....;
}
I need something like this in PHP..
Can anybody Help me?
syntax is the same as c. for example:
<?php
for($i=0; $i < 50; $i++)
{
//skip numbers 4
if($i == 4)
{
continue;
}
//exit early
if($i == 25)
{
break;
}
//print each result
echo $i;
}
?>
johnsquibb
Junior Poster in Training
84 posts since Nov 2007
Reputation Points: 14
Solved Threads: 14