Home / CSE / PHP - CS :: Discussion

Discussion :: PHP - CS

  1. What will be the output of the following PHP code?

    <?php

    $user = array("Ashley", "Bale", "Shrek", "Blank");

    for ($x=0; $x < count($user); $x++)

    {

    if ($user[$x] == "Shrek") continue;

    printf ($user[$x]);

    }

    ?>

  2. A.

     AshleyBale

    B.

     AshleyBaleBlank

    C.

     ShrekBlank

    D.

     Shrek

    View Answer

    Workspace

    Answer : Option B

    Explanation :

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


Be The First To Comment