mardi 4 août 2015

ucfirst() not working properly with scandinavic characters

How to get ucfirst() working with scandinavic characters?

$str = "SÄKYLÄ";
echo ucfirst(strtolower($str)); //prints SÄkylÄ

One possibility is use mb_convert_case() but I'd like to know if this is possible using ucfirst()

$str = "SÄKYLÄ";
echo mb_convert_case($str, MB_CASE_TITLE, "UTF-8"); //prints Säkylä

Which function is faster for string capitalization?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire