Home / CSE / PHP - CS :: Operators and Expressions in php

CSE :: PHP - CS

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

    <?php

    $color = "red";

    $color = "green";

    echo "$color";

    ?>

  2. A.

     red

    B.

     green

    C.

     red green

    D.

     error

    View Answer

    Workspace

    Discuss Discuss in Forum


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

    <?php

    $color1 = "red";

    $color2 = "green";

    echo "$color1" . "$color2";

    ?>

  4. A.

     red

    B.

     green

    C.

     red green

    D.

     redgreen

    View Answer

    Workspace

    Discuss Discuss in Forum


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

    <?php

    $color1 = "red";

    $color2 = "green";

    echo "$color1" + "$color2";

    ?>

  6. A.

     redgreen

    B.

     red green

    C.

     0

    D.

     error

    View Answer

    Workspace

    Discuss Discuss in Forum


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

    <?php

    $color1 = "red";

    $color2 = "red";

    echo "$color1" + "$color2";

    ?>

  8. A.

     redgreen

    B.

     red green

    C.

     0

    D.

     1

    View Answer

    Workspace

    Discuss Discuss in Forum


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

    <?php

    $color1 = "red";

    $color2 = "1";

    echo "$color1" + "$color2";

    ?>

  10. A.

     red1

    B.

     red 1

    C.

     0

    D.

     1

    View Answer

    Workspace

    Discuss Discuss in Forum


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

    <?php

    $color1 = "1";

    $color2 = "1";

    echo "$color1" + "$color2";

    ?>

  12. A.

     11

    B.

     2

    C.

     0

    D.

     1

    View Answer

    Workspace

    Discuss Discuss in Forum


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

    <?php

    $color1 = "red";

    $color2 = "1";

    $color3 = "grey"

    echo "$color1" + "$color2" . "$color3";

    ?>

  14. A.

     1grey

    B.

     grey

    C.

     0

    D.

     red1grey

    View Answer

    Workspace

    Discuss Discuss in Forum


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

    <?php

    echo "This", "was", "a", "bad", "idea";

    ?>

  16. A.

     This, was, a, bad, idea

    B.

     This was a bad idea

    C.

     Thiswasabadidea

    D.

     Error

    View Answer

    Workspace

    Discuss Discuss in Forum


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

    <?php

    echo "This"."was"."a"."bad"."idea";

    ?>

  18. A.

     This, was, a, bad, idea

    B.

     This was a bad idea

    C.

     Thiswasabadidea

    D.

     Error

    View Answer

    Workspace

    Discuss Discuss in Forum


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

    <?php

    echo "This","was"|"a","bad"."idea";

    ?>

  20. A.

     Thiswasabadidea

    B.

     Thiswasbadidea

    C.

     Thiswas a badidea

    D.

     Thiswas abadidea

    View Answer

    Workspace

    Discuss Discuss in Forum