PHP continue Keyword

P
PHP declare Keyword
PHP const Keyword

In this article, you will learn how to skip the iteration in for, foreach, while, do..while loop in PHP. The continue keyword in PHP is used to is used to end the current iteration in a for, foreach, while or do..while loop, and continues to the next iteration..

examples of the CONTINUE keyword

Example 1. In this example, we use continue to skip over the “5” part of the code in a loop.

<?php
for($i = 1; $i <= 10; $i++) {
  if($i == 5) {
    continue;
  }
echo "$i <br>";
}
?>
PHP declare Keyword
PHP const Keyword

Tutor Network

Share this

Learn PHP from A to Z