I'm looking for a way to uppercase the first letter/s of a string, including where the names are joined by a hyphen, such as adam smith-jones needs to be Adam Smith-Jones.
ucwords()
(or ucfirst()
if I split them into firstname, lastname) only does Adam Smith-jones
$string = implode('-', array_map('ucfirst', explode('-', $string)));
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