PHP Functions


  1. What will be the output of the following PHP code?
    <?php
    echo lcfirst("HELLO FRIENDS");
    ?>











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    The lcfirst() function converts the first character of a string to lowercase.


  1. What will be the output of the following PHP code?
    <?php
    echo hex2bin("496e74657276696577204d616e6961");
    ?>











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    The hex2bin() function converts a string of hexadecimal values to ASCII characters.



  1. What will be the output of the following PHP code?
    <?php 
    $string = addslashes('how are "you" doing?');
    echo $string;
    ?>











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    The addslashes() function returns a string with backslashes in front of predefined characters.


  1. What will be the output of the following PHP code?
    <?php
    $string = "Hello Interview Mania. It's a knowledgeable website.";
    print_r (explode(" ",$string));
    ?>











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    The explode() function breaks a string into an array.



  1. What will be the output of the following PHP code?
    <?php
    echo strtr("Hilla Interview Mania","ia","eo");
    ?>











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    The strtr() function translates certain characters in a string.