In PHP, I have an array of variables that are ALL strings. Some of the values stored are numeric strings with commas.
What I need:
A way to trim the comma
function cleanData($a) { if(is_numeric($a)) { $a = preg_replace('/[^0-9,]/s', '', $a); } return $a; }