0
I’m bringing the user data from BD Mysql. The names were saved in high box. I am creating a greeting for this user taking only the first name.
list($nome,$sobrenome) = explode(" ",$pe->NomeUsuario);
The result was so:
Welcome back to TULIO
But I want to leave it that way:
Welcome back to Tulio
For that I tried to do the function below:
function converter($palavra){ //
$minusculas = array("á", "à", "â", "ã", "ä", "é", "è", "ê", "ë", "í", "ì", "î", "ï", "ó", "ò", "ô", "õ", "ö", "ú", "ù", "û", "ü", "ç");
$maiusculas = array("Á", "À", "Â", "Ã", "Ä", "É", "È", "Ê", "Ë", "Í", "Ì", "Î", "Ï", "Ó", "Ò", "Ô", "Õ", "Ö", "Ú", "Ù", "Û", "Ü", "Ç");
$converter = str_replace($maiusculas, $minusculas, $palavra);
return ucfirst($converter);
}
list($nome,$sobrenome) = explode(" ",converter($pe->NomeUsuario));
But the result is:
Thulium
How can I convert TULIO to Tulio?
Hello Rafael. I had managed this way and was going to post here
$converter = mb_strtolower($palavra,'UTF-8');
return ucfirst($converter);
, but your solution was better than mine, because I created a function and solved in only 1 line. Thank you!– user24136