PHP ucwords() Function
In this chapter you will learn:
- Definition for PHP ucwords() Function
- Syntax for PHP ucwords() Function
- Parameter for PHP ucwords() Function
- Return for PHP ucwords() Function
- Example - Convert words in a string to uppercase
Definition
The ucwords()
function takes string and converts the first letter of each
word to an uppercase character.
Syntax
PHP ucwords() Function has the following syntax.
string ucwords ( string str )
Parameter
str
is the string we want to convert.
Return
PHP ucwords() function returns the converted string.
Example
Convert words in a string to uppercase
<?PHP//from ja v a 2 s .c o m
$string = "this is a test from java2s.com";
$a = ucwords($string);
print($a);
?>
The code above generates the following result.
Next chapter...
What you will learn in the next chapter:
- Description for PHP utf8_decode() Function
- Syntax for PHP utf8_decode() Function
- Parameter for PHP utf8_decode() Function
- Return value for PHP utf8_decode() Function
- Example - Use utf8_decode
Home » PHP Tutorial » PHP String Functions