I have the following value:
$ 1,524.33
I need to write to the database, in the format: 1524.33
How can I do this?
I have the following value:
$ 1,524.33
I need to write to the database, in the format: 1524.33
How can I do this?
Use the str_replace
function:
<?
$valor_sem_ponto = str_replace(',', '.', str_replace('.', '', "1.524,33"));
echo $valor_sem_ponto;
?>
Result
1524.33