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?
You could do $num = (float) str_replace(',', '', $num); Basically, just get rid of the commas, and then cast it as a numeric type (float or int).
$num = (float) str_replace(',', '', $num);