Home » PHP » PHP Introduction » Question
  1. What will be the output of the following PHP code?
    <?php
    $user = array("Ats ", "Ajit ", "Rahul ", "Aju ");
    for ($str=0; $str < count($user); $str++) {
    if ($user[$str] == "Rahul ") continue;
    printf ($user[$str]);
    }
    ?>
    1. Error
    2. Rahul
    3. Ats Ajit Aju
    4. Ats Ajit Rahul Aju
    5. None of these
Correct Option: C

The continue statement causes execution of the current loop iteration to end and commence at the beginning of the next iteration.



Your comments will be displayed only after manual approval.