PHP Echo/Print


  1. What will be the output of the following PHP code ?
    <?php
    $First = "Mania";
    $Second = "Interview";
    echo "$First"+"$Second";
    ?>











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    In an echo statement you can not use plus sign to join two strings.


  1. What will be the output of the following PHP code ?
    <?php
    $First = "Hello ";
    $Second = "Interview Mania";
    echo $First, $Second;
    ?>











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    Echo can print two variables which are separated by a comma.



  1. What will be the output of the following PHP code ?
    <?php
    $First = "Interview ";
    $Second = "Mania";
    echo "$First$Second";
    ?>











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    Even though both the variables are inside the double-quotes, the value of the variable is substituted and then printed to the screen.


  1. What will be the output of the following PHP code ?
    <?php
    echo "it","is"|"a","good"."name";
    ?>











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    You can use only comma and dot operator to join starings, other characters do not have the same function.



  1. What will be the output of the following PHP code ?
    <?php
    echo "This is <i>Interview Mania</i>";
    ?>











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    This is Interview Mania