Convert the first character of each word to uppercase:
<?phpecho ucwords("hello world");?>The ucwords() function converts the first character of each word in a string to uppercase.
Note: This function is binary safe.
Related functions:
ucfirst() - Converts the first character in a string to uppercase
lcfirst() - Converts the first character in a string to lowercase
strtoupper() - Convert a string to uppercase
strtolower() - Convert a string to lowercase
ucwords( string )
parameter | describe |
---|---|
string | Required. Specifies the string to be converted. |
Return value: | Returns the converted string. |
---|---|
PHP version: | 4+ |