PHP Next Loop Iteration
To proceed
to the next loop iteration, use
the continue operator.
Let's use a loop to display
numbers from 1 to 5, but if the
number is 3 - immediately proceed to
the next iteration:
<?php
for ($i = 1; $i <= 5; $i++) {
if ($i == 3) {
continue;
}
echo $i;
}
?>
Code execution result:
1
2
4
5