I currently use the following code in php to format a value in PT-BR (22,222.22)
// Colocar valor no padram 0,000,000.00
$valor_antigo = "22222.22";
$valor = number_format($valor_antigo, 2, ',', '.');
My question is how to do it the other way around.