How to convert the first character to uppercase

There is a string, you need to convert the first character to uppercase…

ucfirst();

Cyrillic doesn’t work….


Answer 1, authority 100%

Two solutions are offered at php.net:

<?php 
function ucfirst_utf8($stri){ 
 if($stri{0}>="\xc3") 
     return (($stri{1}>="\xa0")? 
     ($stri{0}.chr(ord($stri{1})-32)): 
     ($stri{0}.$stri{1})).substr($stri,2); 
 else return ucfirst($stri); 
} 
?>

and

<?php 
function mb_ucasefirst($str){ 
    $str[0] = mb_strtoupper($str[0]); 
    return $str; 
} 
?>

Try which one suits you.