I have the value like admin,bli
I have used this code to make the first letter capital
<?php ucfirst('admin,bli'); ?>
And my result is Admin,bli
My expected output is
Admin,Bli
How can I achieve this without using explode function and a for loop?
Explode by comma, map
ucfirstevery item usingarray_mapand implode it back byjoinorimplode.I know you'd like to avoid explode, but its probably quicker than
preg_replace_callbackanyway.