Function Syntax:
string ucwords ( string str );
Function Details:
Returns a string with the first character of each word in str capitalized, if that character is alphabetic.
The definition of a word is any string of characters that is immediately after a whitespace (These are: space, form-feed, newline, carriage return, horizontal tab, and vertical tab).
Example 1. ucwords() example
$foo = 'hello world!';
$foo = ucwords($foo); //Output: Hello World!
Example 2. ucwords() example
$bar = 'HELLO WORLD!';
$bar = ucwords($bar); //Output: HELLO WORLD!
$bar = ucwords(strtolower($bar)); //Output: Hello World!
Was this information useful? What other tips would you like to read about in the future? Share your comments, feedback and experiences with us by commenting below!
Like our site? Be a member of Coolajax fan page to get daily posts updates!
You May Like This Posts!
» How to strrpos function work?
» How to strstr function works?
» How to substr function works?
Tags:
ucwords, ucwords function,php ucwords, string capitalized, first character capitalized, php tutorial
Total Read: 514 Topics