<?php
$arr = 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'); $check = '#^[()\\-\\s]*(([+][()\\-\\s]*7)|8)([()\\-\\s]*[0-9]){10}$#';
$replace = '#\\+7#';
$clean = '#\\W#';
foreach ($arr as $input){
echo "Верно\n";
}else{
echo"Ошибка\n";
}
echo $outputFinal."\n";}
PD9waHAKZXJyb3JfcmVwb3J0aW5nKC0xKTsKCiRhcnIgPSBhcnJheSgnODQ5NTEyMzQ1NjcnLCAnKzc0OTUxMjM0NTY3JywgJzgtNDk1LTEtMjM0LTU2NycsICcgOCAoODEyMikgNTYtNTYtNTYnLCAnOC05MTEtMTIzNDU2NycsICc4ICg5MTEpIDEyIDM0NSA2NycsICc4LTkxMSAxMiAzNDUgNjcnLCAnOCAoOTExKSAtIDEyMyAtIDQ1IC0gNjcnLCAnKyA3IDk5OSAxMjMgNDU2NycsICc4ICggOTk5ICkgMTIzNDU2NycsICc4IDk5OSAxMjMgNDU2NycpOwokY2hlY2sgPSAnI15bKClcXC1cXHNdKigoWytdWygpXFwtXFxzXSo3KXw4KShbKClcXC1cXHNdKlswLTldKXsxMH0kIyc7CiRyZXBsYWNlID0gJyNcXCs3Iyc7CiRjbGVhbiA9ICcjXFxXIyc7CmZvcmVhY2ggKCRhcnIgYXMgJGlucHV0KXsKaWYocHJlZ19tYXRjaCgkY2hlY2ssICRpbnB1dCkpewoJZWNobyAi0JLQtdGA0L3QvlxuIjsKfWVsc2V7CgllY2hvItCe0YjQuNCx0LrQsFxuIjsKfQoKJG91dHB1dCA9IHByZWdfcmVwbGFjZSgkY2xlYW4sICIiLCAkaW5wdXQpOwokb3V0cHV0RmluYWwgPSBwcmVnX3JlcGxhY2UoJHJlcGxhY2UsICI4IiwgJG91dHB1dCk7CmVjaG8gJG91dHB1dEZpbmFsLiJcbiI7fQo=