74 of 110 menu

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
English
БеларускаяEspañolРусский
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline