string ucwords
Capitalizes the first character of each word in str if that character is alphabetic.
Example 1. ucwords() example
1 2 $text = "mary had a little lamb and she loved it so."; 3 $text = ucwords($text); // $text is now: Mary Had A Little Lamb And She Loved It So. 4
See also strtoupper(), strtolower() and ucfirst().