For a single word, the right way is: mb_convert_case
with MB_CASE_TITLE
in second argument.
mb_internal_encoding('UTF-8');
echo mb_convert_case('çağla', MB_CASE_TITLE);
Because it depends on the charset and locale: some languages distinguish uppercase to titlecase. Here, titlecasing is more appropriate.
An example: the digram character dz. Which becomes DZ in uppercase but Dz in titlecase. This is not the same thing.
Note: mb_convert_case
+ MB_CASE_TITLE
alone is equivalent to ucwords. The strict equivalent of ucfirst would be:
return mb_convert_case(mb_substr($str, 0, 1), MB_CASE_TITLE) . mb_substr($str, 1);