Home / CSE / PHP - CS :: Functions in PHP

CSE :: PHP - CS

  1. Which of the following PHP functions can be used for generating unique id’s?

  2. A.

     uniqueid()

    B.

     id()

    C.

     md5()

    D.

     mdid()

    View Answer

    Workspace

    Discuss Discuss in Forum


  3. Which one of the following functions can be used to compress a string?

  4. A.

     zip_compress()

    B.

     zip()

    C.

     compress()

    D.

     gzcompress()

    View Answer

    Workspace

    Discuss Discuss in Forum


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

    <?php

    echo "chr(52)";

    ?>

  6. A.

     1

    B.

     2

    C.

     3

    D.

     4

    View Answer

    Workspace

    Discuss Discuss in Forum


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

    <?php

    echo ord ("hi");

    ?>

  8. A.

     106

    B.

     103

    C.

     104

    D.

     209

    View Answer

    Workspace

    Discuss Discuss in Forum


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

    <?php

    $str = "Hello World"

    echo wordwrap($str,5,"n");

    ?>

  10. A.

     Hello World

    B.

     Hello
    World

    C.

     Hell 0 Wo rld

    D.

     World

    View Answer

    Workspace

    Discuss Discuss in Forum


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

    <?php

    echo ucwords("i love my country");

    ?>

  12. A.

     I love my country

    B.

     i love my Country

    C.

     I love my Country

    D.

     I Love My Country

    View Answer

    Workspace

    Discuss Discuss in Forum


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

    <?php

    echo lcfirst("welcome to India");

    ?>

  14. A.

     welcome to India

    B.

     welcome to india

    C.

     Welcome to India

    D.

     Welcome to india

    View Answer

    Workspace

    Discuss Discuss in Forum


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

    <?php

    function calc($price, $tax="")

    {

    $total = $price + ($price * $tax);

    echo "$total";

    }

    calc(42);

    ?>

  16. A.

     Error

    B.

     0

    C.

     42

    D.

     84

    View Answer

    Workspace

    Discuss Discuss in Forum


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

    <?php

    function a()

    {

    function b()

    {

    echo 'I am b';

    }

    echo 'I am a';

    }

    a();

    a();

    ?>

  18. A.

     I am b

    B.

     I am bI am a

    C.

     Error

    D.

     I am a Error

    View Answer

    Workspace

    Discuss Discuss in Forum


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

    <?php

    function a()

    {

    function b()

    {

    echo 'I am b';

    }

    echo 'I am a';

    }

    b();

    a();

    ?>

  20. A.

     I am b

    B.

     I am bI am a

    C.

     Error

    D.

     I am a Error

    View Answer

    Workspace

    Discuss Discuss in Forum