Remove phone formatting

I used this function to strip the formatting from a submitted phone number and return just the numbers e.g. 1234567890

$phone = preg_replace(‘/\D+/’, ”, $entry[8]);

print_r($phone);

The phone number was formatted like this (123)456-7890

Leave a Reply