php skip current loop iteration code example
Example 1: php skip loop
for ($i=0; $i <= 12; $i++) {
if($1 == 5){
continue;
}
//code block
//code block ends
}
Example 2: php continue
<?php
for ($i = 0; $i < 5; ++$i) {
if ($i == 2)
continue
print "$i\n";
}
?>
Example 3: skip an iteration php
<?php
for ($x = 0; $x < 10; $x++) {
if ($x == 4) {
continue;
}
echo "The number is: $x <br>";
}
?>