How to uppercase the first letter of a string in PHP
In this tutorial, we are going to learn about how to uppercase the first letter of a string in PHP.
Using ucfirst() function
To uppercase the first letter of a string, we can use the ucfirst() function in PHP.
The ucfirst() function takes the string as a argument and converts the first character of it to uppercase.
Here is an example:
$name = "gowtham";
$capitalize = ucfirst($name);
echo $capitalize;
Output:
Gowtham