php ucwords() function


  Translation results:

UK [wɜ:dz] US [wɜ:dz]

n.字(plural noun of word); (said) words; promises; passwords

php ucwords() functionsyntax

Function: Convert the first character of each word to uppercase

Syntax: ucwords(string)

Parameters:

ParametersDescription
stringRequired, Specifies the string to be converted

Description: Converts the first character of each word in the string to uppercase. This function is binary safe.

php ucwords() functionexample

<?php
$i = "hello world";
$j = ucwords($i);
echo $j;
?>

Run instance»

Click the "Run instance" button to view the online instance

Output:

Hello World
<?php
$i = "I'm study in php.cn";
$j = ucwords($i);
echo $j;
?>

Run instance»

Click the "Run instance" button to view the online instance

Output:

I'm Study In Php.cn

Home

Videos

Q&A