"> What will be the output of the following PHP code ?<?php$p

Home » PHP » PHP Variables » Question
  1. What will be the output of the following PHP code ?
    <?php
    $p = "$Test";
    $q = "\$Example";
    echo $p, $q;
    ?>
    1. $Example
    2. \
    3. $Test
    4. Nothing
    5. None of these
Correct Option: A

As there is a backslash before $ it takes it as a string and not a variable therefore we get $Example as the output.



Your comments will be displayed only after manual approval.