Programming Tips - PHP: make a string title case in PHP

Date: 2010mar28 Update: 2025jul5 Language: php Q. PHP: make a string title case in PHP A. Use ucwords() to make the first letter of each word uppercase
$title = ucwords('hello world'); print "title=$title\n";
Outputs:
Hello World
There is also ucfirst() which only uppercases the first letter
$title = ucfirst('hello world'); print "title=$title\n";
Outputs:
Hello world