I've asked about strtolower
function. But when using foreign characters it doesn't convert them into uppercase, so I must use:
mb_strtolower($a,"utf8");
But what can I do, if I want to use ucfirst()
function? I haven't found any similar function, where I can set encoding type.
This is more concise solution, although it is rather similar to
ucwords
function:If you need to capitalize string consist of one word, it is the best solution.
as of 2019-11-18, it seems nobody on stackoverflow got this right, here's how mb_ucfirst() should be implemented in userland: