How Can I Capitalize Each Word of a String

The ucwords() function capitalizes the first letter of all the words in a string.

Example

Actual PHP Output

Hello World!