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

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

Since two backslashes are used together, a single backslash is printed on the screen and as $looser is not initialised only single backslash is printed.



Your comments will be displayed only after manual approval.