PHP Strings


  1. What will be the output of the following PHP code?
    <?php
    $Message = "this is important message...";
    echo ucwords($Message);
    ?>











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    The ucwords() function capitalizes the first letter of each word in a string. Its prototype follows: string ucwords(string str).


  1. Which one of the following functions can be used to concatenate array elements to form a single delimited string?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    implode()



  1. Which one of the following functions finds the last occurrence of a string, returning its numerical position?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    strrpos()


  1. What will be the output of the following PHP code?
    <?php
    $contact = "inter0view@mania.com";
    $contact = str_replace("0","@",$contact);
    echo "Contact to the Interview Mania web designer at $contact.";
    ?>











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    The str_replace() function case sensitively replaces all instances of a string with another.