Home » PHP » PHP Arrays » Question
  1. What will be the output of the following PHP code?
    <?php
    $Student = array("Rahul", "Ajit", "Ats");
    echo $Student[0] . " is the friend of " . $Student[1] . " and " . $Student[2] . ".";
    ?>
    1. Rahul
    2. Error
    3. Rahul is the friend of Ajit and Ats.
    4. Nothing
    5. None of these
Correct Option: C

Simple definition of array and using it in a string. We have used $Student [1],$Student [1] and hence Ajit, Ats appears.



Your comments will be displayed only after manual approval.