Using continue instead of break : continue « Statement « PHP






Using continue instead of break

 
<?php

$counter=-3;

for (;$counter<10;$counter++){
    if ($counter==0){
        echo "Skipping to avoid division by zero.<br>";
        continue;
    }

    echo "100/$counter ",100/$counter,"<br />";
}

?>
  
  








Related examples in the same category

1.Continue statement
2.Using the continue Statement
3.Continue Statement
4.Using the continue Statement
5.continue within a for loop