Remove Money Formatting

This will remove all non-integer characters, including commas and currency symbols. The output is a float.

$float = floatval(preg_replace('/[^\d\.]/', '', '$100.25')); // 100.25
Share on facebook
Facebook
Share on twitter
Twitter
Share on linkedin
LinkedIn