RegEx, Php, Preg_match, Phone numbers, Oh my!
- by Kirk
How do I find phone number of the following format and store them to a variable.
It needs to match 3334445555, 333.444.5555, 333-444-5555, 333 444 5555, (333) 444 5555 and all combinations thereof.
Here is the frame of it
$regex = expression;
if (preg_match ('/$regex/', matches))
{
$phone = matches[1];
}