Complete the code to convert the string to uppercase.
<?php $text = "hello world"; echo [1]($text); ?>
The strtoupper function converts all characters in a string to uppercase.
Complete the code to convert the string to lowercase.
<?php $text = "HELLO WORLD"; echo [1]($text); ?>
The strtolower function converts all characters in a string to lowercase.
Fix the error in the code to capitalize the first letter of each word.
<?php $text = "hello world"; echo [1]($text); ?>
The ucwords function capitalizes the first letter of each word in a string.
Fill both blanks to convert the string to lowercase and then capitalize the first letter.
<?php $text = "HELLO WORLD"; $lower = [1]($text); $result = [2]($lower); echo $result; ?>
First, strtolower converts the string to all lowercase. Then, ucfirst capitalizes the first letter of the string.
Fill all three blanks to convert the string to lowercase, then capitalize the first letter of each word, and finally convert the whole string to uppercase.
<?php $text = "hello world"; $lower = [1]($text); $capitalized = [2]($lower); $upper = [3]($capitalized); echo $upper; ?>
First, strtolower makes all letters lowercase. Then, ucwords capitalizes the first letter of each word. Finally, strtoupper converts the entire string to uppercase.