Is there any function in PHP to make the first character of the word uppercase, or should I write it by regular expression?
Use the ucfirst function.
$word = ucfirst($word);
$firstlettersuppercased = ucwords($originalstring);
This will capitalize the first letter of every word in the $originalstring.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With