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