Home » PHP » PHP Functions » Question
  1. What will be the output of the following PHP code ?
    <?php
    function uppercase($str)
    {
    echo ucwords($str);
    }
    $fun = "uppercase";
    $fun("time to do a great job.");
    ?>
    1. Error
    2. Time To Do A Great Job.
    3. time to do a great job.
    4. Nothing
    5. None of these
Correct Option: B

The ucwords() function converts the first character of each word in a string to uppercase.



Your comments will be displayed only after manual approval.