The PHP built-in function ucfirst() is used to the first letter of a string to uppercase. You can also use the PHP function strtolower() with the combination of ucfirst() function.
Let's check the following example to understand how this function actually works
<?php $string1 = 'welcome to America'; echo ucfirst($string1); echo "<br>"; $string2 = 'nice to meet you'; echo ucfirst(strtolower($string2)); ?>
OUTPUT
Welcome to America
Nice to meet you
Please Login to Post the answer