$q = durham-region;
$q = ucfirst($q);
$q = Durham-region;
How would I capitalize the letter after the dash (Durham-Region)? Would I have to spli
Yes. ucfirst()
simply capitalized the first letter of the string. If you want multiple letters capitalized, you must create multiple strings.
$strings = explode("-", $string);
$newString = "";
foreach($strings as $string){
$newString += ucfirst($string);
}
function ucfirst_all($delimiter, $string){
$strings = explode("-", $string);
$newString = "";
foreach($strings as $string){
$newString += ucfirst($string);
}
return $newString;
}