PHP Syntax


  1. What will be the output of the following PHP code ?
    <?php
    $country = "India";
    echo "$country";
    echo "$COUNTRY";
    echo "$Country";
    ?>











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    In PHP, all variables are case-sensitive.


  1. What will be the output of the following PHP code ?
    <?php
    # echo "Hello interview Mania";
    echo "# Hello interview Mania";
    ?>











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    # is a single line comment.



  1. What will be the output of the following PHP code ?
    <?php
    echo "Hello Interview Mania"
    ?>











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    You can use tags like italics, bold etc. inside php script.


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











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    It would have printed echo “Hello world” if the statement was echo “echo \”Hello Interview Mania\””;.



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











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    You can not have php tags inside a php tag.