php continue

https://www.php.net/manual/en/control-structures.continue.php

for ($x = 0; $x <= 10; $x++) {
    if ($x == 3) continue;
    echo “The number is: $x <br>”;
  }

 

<?php
$arr = ['zero', 'one', 'two', 'three', 'four', 'five', 'six'];
foreach ($arr as $key => $value) {
if (0 === ($key % 2)) { // skip members with even key
continue;
}
echo $value . "\n";
}
?>
Scroll to Top