PHP ucwords() Function
Example
Convert the first character of each word to uppercase:
Run Example »
Definition and Usage
The ucwords() function converts the first character of each word in a string to uppercase.
**Note:** This function is binary-safe.
Related functions:
- ucfirst() - Convert the first character of a string to uppercase
- lcfirst()- Convert the first character of a string to lowercase
- strtoupper() - Convert a string to uppercase
- strtolower() - Convert a string to lowercase
Syntax
ucwords(
string
)
| Parameters | Description |
|---|---|
| string | Required. Specifies the string to convert. |
Technical Details
| Return Value: | Returns the converted string. |
|---|---|
| PHP Version: | 4+ |
PHP String Reference Manual