Multiple choice

If you wanted to capitalize the first letter of each word in a string, which function would you use?

  1. Strtolower()

  2. Strtoupper()

  3. Ucwords()

  4. Ucfirst()

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

In PHP, the function ucwords() is specifically designed to convert the first character of each word in a string to uppercase. Ucfirst() only affects the very first letter of the entire string.