ucwords in php

ucwords — Uppercase the first character of each word in a string.

Example

<?php
$foo = 'hello world!';
$foo = ucwords($foo);             // Hello World!
echo $foo; 
$bar = 'HELLO WORLD!';
$bar = ucwords($bar);             // HELLO WORLD!
$bar = ucwords(strtolower($bar)); // Hello World!
?>