The
continue
statement breaks only one iteration in the loop and continues with the next iteration
for ($x = 0;  $x < 10;  $x++) {
  if ($x == 7) {
    continue;
  }
  echo "$x"."\n";
}
echo "\n\n";
Prints Only numbers evenly divisible by 2
for ($x = 0;  $x < 10;  $x++) {
  if ($x%2 == 1) {
    continue;
  }
  echo "Example2: $x"."\n";
}
by Valeri Tandilashvili
2 years ago
PHP
Loops
1
Pro tip: use ```triple backticks around text``` to write in code fences