<?php
$correctNumbers = array ( '84951234567' , '+74951234567' , '8-495-1-234-567' , ' 8 (8122) 56-56-56' , '8-911-1234567' , '8 (911) 12 345 67' , '8-911 12 345 67' , '8 (911) - 123 - 45 - 67' , '+ 7 999 123 4567' , '8 ( 999 ) 1234567' , '8 999 123 4567' ) ; $wrongNumbers = array ( '02' , '84951234567 позвать люсю' , '849512345' , '849512345678' , '8 (409) 123-123-123' , '7900123467' , '5005005001' , '8888-8888-88' ,
'84951a234567' , '8495123456a' ,
'+1 234 5678901' , // неверный код страны
'+8 234 5678901' , // либо 8 либо +7'7 234 5678901' // нет +
) ;
$testNumber = '+7-(-911)-50-65-656' ;
$regexp = '/^([+]7|8)([(]|[)]|-)*\\d{3}([(]|[)]|-)*(\\d([(]|[)]|-)*){6}\\d$/u' ;
$regexpOne = '/[+]7/' ;
$regexpTwo = '/[^0-9]/' ;
//for ($i = 1; $i <= 5; $i++) {
echo "Правильно набран номер\n " ;
echo $result ;
} else {
echo "Неправильно набран номер" ;
}
PD9waHAKIAplcnJvcl9yZXBvcnRpbmcoLTEpOwogCiRjb3JyZWN0TnVtYmVycyA9IGFycmF5KCc4NDk1MTIzNDU2NycsICcrNzQ5NTEyMzQ1NjcnLCAnOC00OTUtMS0yMzQtNTY3JywgJyA4ICg4MTIyKSA1Ni01Ni01NicsICc4LTkxMS0xMjM0NTY3JywgJzggKDkxMSkgMTIgMzQ1IDY3JywgJzgtOTExIDEyIDM0NSA2NycsICc4ICg5MTEpIC0gMTIzIC0gNDUgLSA2NycsICcrIDcgOTk5IDEyMyA0NTY3JywgJzggKCA5OTkgKSAxMjM0NTY3JywgJzggOTk5IDEyMyA0NTY3Jyk7CiR3cm9uZ051bWJlcnMgPSBhcnJheSgnMDInLCAnODQ5NTEyMzQ1Njcg0L/QvtC30LLQsNGC0Ywg0LvRjtGB0Y4nLCAnODQ5NTEyMzQ1JywgJzg0OTUxMjM0NTY3OCcsCic4ICg0MDkpIDEyMy0xMjMtMTIzJywgJzc5MDA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