How do I make the first letter of a string uppercase?
The answer to your enquiry is the function called ucfirst() which doesn't mean you were the first person to see, but rather UpperCaseFirst.
Like this:
<?php
$unexpected = " how are you today?";
echo ucfirst($unexpected);
// how are you today?
?>
Note that you didn't get the expected result here, and that's because the first character is actually a space.
The lesson is, when using this function it is best to always pass the string through trim first to get rid of any leading space, so you always get the expected results:
<?php
$expected = " how are you today?";
echo ucfirst(trim($expected));
//How are you today?
?>
More strings PHP Questions
How do I make the contents of a string upper case?How can I repeat a string variable several times?
How do I escape a string with slashes?
How can I remove spaces from around a string value?
How do I join strings together?