PHP ucwords() Function
Complete PHP String Reference
Example
Convert the first character of each word to uppercase:
<?php
echo ucwords("hello world");
?>
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() - converts the first
character of a string to uppercase
- lcfirst() - converts the first
character of a string to lowercase
- strtolupper() - converts a
string to uppercase
- strtolower() - converts a
string to lowercase
Syntax
| Parameter |
Description |
| string |
Required. Specifies the string to convert |
Technical Details
| Return Value: |
Returns the converted string |
| PHP Version: |
4+ |
Complete PHP String Reference
Thank You For Helping Us!
Your message has been sent to W3Schools.
Close [X]