PHP can\'t recognize 1,200.00(generated by number_format) but only 1200.00,
1,200.00
number_format
1200.00
What\'s the general solution for this problem?
use "[^0-9.]+" regex.
$formattedVal = '$9,99,999.99'; $unformattedVal = (float)preg_replace("/[^0-9.]+/", "", $formattedVal); var_dump($unformattedVal);
worked for me.