(PHP 4, PHP 5, PHP 7)
ucwords — Uppercase the first character of each word in a string
ucwords ( string $string [, string $separators = " \t\r\n\f\v" ] ) : string
Returns a string with the first character of each word in string
capitalized, if that character is alphabetic.
The definition of a word is any string of characters that is immediately after any character listed in the separators
parameter (By default these are: space, form-feed, newline, carriage return, horizontal tab, and vertical tab).
string
The input string.
separators
The optional separators
contains the word separator characters.
Returns the modified string.
Example #1 ucwords() example
Example #2 ucwords() example with custom delimiter
Note: This function is locale-aware and will handle input according to the currently set locale. However, it only works on single-byte character sets. If you need to use multibyte characters (most non-western-European languages) look at the multibyte or intl extensions instead.
Note: This function is binary-safe.
© 1997–2020 The PHP Documentation Group
Licensed under the Creative Commons Attribution License v3.0 or later.
https://www.php.net/manual/en/function.ucwords.php