<?php
function checkNumber($text){
$regexp = "/^8?(?-?)[0-9]{3}?-[0-9]{3}?-[0-9]{2}?-[0-9]{2}$/u";
echo "Номер введен верно.";
}else{
echo "Номер введен в неверном формате";
}
}
checkNumber("84951234567");
PD9waHAKCmZ1bmN0aW9uIGNoZWNrTnVtYmVyKCR0ZXh0KXsKCSRyZWdleHAgPSAiL144Pyg/LT8pWzAtOV17M30/LVswLTldezN9Py1bMC05XXsyfT8tWzAtOV17Mn0kL3UiOwoJaWYgKHByZWdfbWF0Y2goJHJlZ2V4cCwgJHRleHQpKXsKCQllY2hvICLQndC+0LzQtdGAINCy0LLQtdC00LXQvSDQstC10YDQvdC+LiI7Cgl9ZWxzZXsKCQllY2hvICLQndC+0LzQtdGAINCy0LLQtdC00LXQvSDQsiDQvdC10LLQtdGA0L3QvtC8INGE0L7RgNC80LDRgtC1IjsKCX0KfQoKY2hlY2tOdW1iZXIoIjg0OTUxMjM0NTY3Iik7