Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

What will be the output of the following PHP code?
<?php
$title = “O’malley wins the heavyweight championship!”;
echo ucwords($title);
?>

What will be the output of the following PHP code?
<?php
$title = “O’malley wins the heavyweight championship!”;
echo ucwords($title);
?>
a) O’Malley Wins The Heavyweight Championship!
b) O’malley Wins The Heavyweight Championship!
c) O’Malley wins the heavyweight championship!
d) o’malley wins the heavyweight championship!

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

Join The Discussion