3v4l.org

run code in 300+ PHP versions simultaneously
<?php $test = '1.000.000,12'; //$old = str_replace('.', '', $test); //$old = (float) str_replace(',', '.', $old); $new = (float) str_replace(array('.', ','), array('', '.'), $test); //echo 'old: ' . $old; //echo '<br>'; echo 'new: ' . $new;

preferences:
58.89 ms | 402 KiB | 5 Q