I
I
igorc752018-07-13 14:23:08
Mobile devices
igorc75, 2018-07-13 14:23:08

How to edge phones through preg_match_all tags?

I can’t understand what’s wrong, I’m trying to parse the phones line by line:

preg_match_all("/^((8|\+7)[\- ]?)?(\(?\d{3}\)?[\- ]?)?[\d\- ]{7,10}$/", "+7(495)000-00-00 +7(925)0000000", $phones, PREG_SET_ORDER);
foreach ($phones as $val) {
        echo "телефон: " . $val[0] . "\n";
    }

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question