Originally Posted by djm0219
I use a simple str_replace for phone numbers (and credit card numbers). Takes care of spaces, dashes, periods, commas and parenthesis.
$value_to_clean = str_replace(array('-',' ','.','(',')',','),'',$value_to_clean);
What would happen if they enter different characters (say someone is pratting about), does your code compensate for these other characters or malfunction?