Make all words lowercase and the first letter of each word uppercase

How would I be able to capitalize the first letter of each word and lower case the incorrectly capitalized letters?

ucwords() will capitilize the first letter of each word. You can combine it with strtolower() to first lowercase everything.

For example:

ucwords(strtolower('HELLO WORLD!')); // Hello World!

Leave a Comment