Convert first character to uppercase:
To convert first character of a string to uppercase we use a function in PHP ucfirst().
Syntax:
ucfirst(string)
This function includes only one parameter that is the string whose first character you need to covert to uppercase.
For Example:
<?php
echo ucfirst("hello this is the string");
?>
Convert first character of each word to Uppercase:
To convert first character of each word to uppercase we use a PHP function ucwords(string).
Syntax:
ucwords(string);
In above function we have to give only one parameter which is the string. It will return the converted string.
For example:
<?php
echo ucwords("hello this is the string");
?>
0 Comment(s)