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

Discussion :: PHP - CS

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

    <?php

    $color = "maroon";

    $var = $color[2];

    echo "$var";

    ?>

  2. A.

     a

    B.

     Error

    C.

     $var

    D.

     r

    View Answer

    Workspace

    Answer : Option D

    Explanation :

    PHP treats strings in the same fashion as arrays, allowing for specific characters to be accessed via array offset notation.


Be The First To Comment