php ucwords() function converts the first character of each word in the string to uppercase. This article introduces the basic usage and examples of php ucwords() function to coders. Interested coders can refer to it.
Definition and usage
ucwords() function converts the first character of each word in the string to uppercase.
Note: This function is binary safe.
Related functions:
Syntaxucwords(string)
Parameters | Description |
---|---|
string | Required. Specifies the string to be converted. |
Technical details
Return value: | Returns the converted string. |
PHP version: | 4+ |
Example
Convert the first character of each word to uppercase:
above This php ucwords() function converts the first character of each word in a string to uppercase (implementation code). This is all the content shared by the editor. I hope it can give you a reference, and I hope you will support this site.
The above introduces the implementation code of the php ucwords function to convert the first character of each word in the string to uppercase, including the words content. I hope it will be helpful to friends who are interested in PHP tutorials.