Problem with accentuating the function of writing the number by PHP spelling

Asked

Viewed 21 times

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, ',', '.');

inserir a descrição da imagem aqui

  • 2

    The problem is the strtoupper($valorextenso), you must use mb_strtoupper($valorextenso, 'UTF-8'), instead. The strtoupper does not support UTF-8.

  • I think this question should be closed because it is duplicated: https://answall.com/questions/84100/strtoupper-accents.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.