The ucfirst()
function takes string and converts
its first letter to an uppercase character.
PHP ucfirst() Function has the following syntax.
string ucfirst ( string str )
str
is the value we want to convert.
PHP ucfirst() function returns the string with first letter converted.
Convert the first letter to uppercase
<?PHP
$string = "java2s.com";
$a = ucfirst($string);
print($a);
?>
The code above generates the following result.