continue within a for loop : continue « Statement « PHP






continue within a for loop

 
<?php
    $usernames = array("grace","doris","gary","nate","missing","tom");
    for ($x=0; $x < count($usernames); $x++) {
        if ($usernames[$x] == "missing") continue;
        echo "Staff member: $usernames[$x] <br />";
    }
?>
  
  








Related examples in the same category

1.Continue statement
2.Using the continue Statement
3.Continue Statement
4.Using the continue Statement
5.Using continue instead of break