I knew that we use continue
to jump to the next iteration in loop
For example
$x = 0;
for( $i = 0; $i < 10; $i++ ) {
if( $i%2 == 0 ) {
continue;
}
$x = $x + $i;
}
In this case we use continue
to skip the even number, but we can do this instead
$x = 0;
for( $i = 0; $i < 10; $i++ ) {
if( $i%2 != 0 ) {
$x = $x + $i;
}
}
Can anyone show me some cases that we MUST use continue
instead of only using opposite condition.