If you use PHP> = 5.3 (or have the "intl" extension installed at least with version 1.0), you can also use the NumberFormatter
class to parse the local value.
$myVal = '7,000'; $nf = new NumberFormatter("en_EN", NumberFormatter::DECIMAL); var_dump($nf->parse($myVal, NumberFormatter::TYPE_INT32));
If you are using a PHP version less than 5.3, you are better off using @KevinS. Decision.
source share