PHP ucwords () function
Examples
The first character of each word to uppercase:
<?php
echo ucwords("hello world");
?>
echo ucwords("hello world");
?>
Running instance »
Definition and Usage
ucwords () function to the first character of each word in a string to uppercase.
Note: This function is binary safe.
Related functions:
- ucfirst () - the first character of the string to uppercase
- lcfirst () - the first character of the string converted to lowercase
- the strtoupper () - convert a string to uppercase
- strtolower () - convert string to lowercase
grammar
ucwords( string )
参数 | 描述 |
---|---|
string | 必需。规定要转换的字符串。 |
technical details
return value: | Returns the converted string. |
---|---|
PHP version: | 4+ |
PHP String Reference