> Why ucfirst() is used in php?

Why ucfirst() is used in php?

Posted at: 2014-12-18 
The ucfirst() function capitalizes the first letter of the string str, if it is alphabetical. Nonalphabetical characters will not be affected. Additionally, any capitalized characters found in the string will be left untouched. Consider this example:


$sentence = "the newest version of PHP was released today!";

echo ucfirst($sentence);

?>

This returns:

The newest version of PHP was released today!