"/>
Home / CSE / PHP - CS :: Discussion

Discussion :: PHP - CS

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

    <?php

    $cars = array("Volvo", "BMW", "Toyota");

    echo "My car is a {$cars[0]}";

    ?>

  2. A.

     My car is a Volvo

    B.

     My car is a BMW

    C.

     My car is a Toyota

    D.

     Error

    View Answer

    Workspace

    Answer : Option A

    Explanation :

    In the echo statement the {$cars[0]} is replaced by the 1st element in cars that is Volvo.


Be The First To Comment