Skip to content

Instantly share code, notes, and snippets.

@Zillionx
Last active October 4, 2015 20:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Zillionx/8ce0c7b3315c4b6de348 to your computer and use it in GitHub Desktop.
Save Zillionx/8ce0c7b3315c4b6de348 to your computer and use it in GitHub Desktop.
Capitalize words with PHP function ucwords... crazy :)
<?PHP
/* http://php.net/manual/en/function.ucwords.php */
// ucwords works only if You add 'strtolower' to make the remaining characters lowercase...
// crazy!
$Fname = ucwords(strtolower("JOHN"));
$Lname = ucwords(strtolower("DOE"));
// John Doe
echo $Fname." ".$Lname;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment