- str_replace: documentation ( source)
<?php
$test = '1.000.000,12';
$old = str_replace('.', '', $test);
$old = (float) str_replace(',', '.', $old);
//$new = str_replace(array('.', ','), array('', '.'), $test);
echo 'old: ' . $old;
//echo '<br>';
//echo 'new: ' . $new;