Latest web development tutorials

PHP ucwords () function

PHP String Reference PHP String Reference

Examples

The first character of each word to uppercase:

<?php
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:


grammar

ucwords( string )

参数 描述
string 必需。规定要转换的字符串。

technical details

return value: Returns the converted string.
PHP version: 4+


PHP String Reference PHP String Reference