I have three values which are being passed via POST to be written to the database, I try to write the data but however it writes with wrong values. The data looks like this:
"valor_liquido": "R$1.000,00",
"valor_bruto": "R$1.000,00",
"valor_desconto": "R$0,00"
In the database they are written as 1.00,1.00 and
I used str_replace to remove the comma, but it did not work.
$estoque->valorbruto = str_replace(',','.',substr($v1,2));