continue in PHP is used to skip the current loop cycle or iteration. It should be used with condition inside loop, when condition becomes true it skips or jumps the current loop cycle. It can be used with any loop like for, while, do-while and foreach.

continue in for loop

<?php
for($a = 0; $a <= 10; $a++){
    if($a == 3)
    {
      continue;
    }
  echo $a;
}

?>

Loop will skip the cycle when $a value equals to 3. So it outputs 1245678910. If you see the output 3 is missing because continue skipped that loop cycle.

continue in while loop

<?php
$a = 0;
while( $a <= 10){
    if($a == 3)
    {
      continue;
    }
  echo $a;
$a++;
}
?>

continue in do while loop

<?php
$a = 0;
do{
    if($a == 3)
    {
      continue;
    }
  echo $a;
$a++;
}while( $a <= 10);
?>

continue in foreach loop

<?php
$numbers = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);

foreach ($numbers as $n) {
  if ($n == 5) 
    continue;
  echo $x;
}

?>