0
Good afternoon guys, with a problem in the "Numberformatter::SPELLOUT" function in PHP, it serves to write the number in full, but even defining the language type PT_BR, it ta printing the accents for example number three; bugado. I already checked the bank and file encoding, ta all in UTF-8 straight, plus accents print all with error.
$formatter = new \NumberFormatter('PT_BR', NumberFormatter::SPELLOUT); //Define a Função do PHP que escreve por extenso
$valorextenso=$formatter->format($line7->valorbruto); //Chama a Função do PHP que escreve por extenso
$valorextenso=strtoupper($valorextenso);
$valor=number_format($line7->valorbruto, 2, ',', '.');
The problem is the
strtoupper($valorextenso)
, you must usemb_strtoupper($valorextenso, 'UTF-8')
, instead. Thestrtoupper
does not support UTF-8.– Inkeliz
I think this question should be closed because it is duplicated: https://answall.com/questions/84100/strtoupper-accents.
– Inkeliz