$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
look
function UpperCaseAfterDash($wyraz)
{
$rozbij = explode('-',$wyraz);
echo $rozbij[0].'-'.
ucfirst($rozbij[1]);
}
UpperCaseAfterDash("input-text");
Above function returns input-Text
If you need only uppercase letter after one dash for example with city names (Jastrzębie-Zdrój) it will be enough, but if you need more than one... , just count how many array elements (after explode in above code) exists, then use loop.
Greets,