<?php
$text = '8-911-400-12-34';
$regexp = array('/^8[0-9]{10}$/', '/^8[(]([0-9]{3})[)][-]([0-9]{3})[ ]([0-9]{2})[ ]([0-9]{2})$/', '/^8[-]([0-9]{3})[-]([0-9]{3})[-]([0-9]{2})[-]([0-9]{2})$/');
echo "Все верно.\n";
} else {
echo "Укажите номер в формате «8(ххх)-ххх хх хх», «8-ххх-ххх-хх-хх» или «8хххххххххх»!\n";
}
PD9waHAKJHRleHQgICAgPSAnOC05MTEtNDAwLTEyLTM0JzsKJHJlZ2V4cCA9IGFycmF5KCcvXjhbMC05XXsxMH0kLycsICcvXjhbKF0oWzAtOV17M30pWyldWy1dKFswLTldezN9KVsgXShbMC05XXsyfSlbIF0oWzAtOV17Mn0pJC8nLCAnL144Wy1dKFswLTldezN9KVstXShbMC05XXszfSlbLV0oWzAtOV17Mn0pWy1dKFswLTldezJ9KSQvJyk7CgppZiAoKHByZWdfbWF0Y2goJHJlZ2V4cFswXSwgJHRleHQpKSB8fCAocHJlZ19tYXRjaCgkcmVnZXhwWzFdLCAkdGV4dCkpIHx8IChwcmVnX21hdGNoKCRyZWdleHBbMl0sICR0ZXh0KSkpewogICAgZWNobyAi0JLRgdC1INCy0LXRgNC90L4uXG4iOwp9IGVsc2UgewogICAgZWNobyAi0KPQutCw0LbQuNGC0LUg0L3QvtC80LXRgCDQsiAg0YTQvtGA0LzQsNGC0LUgwqs4KNGF0YXRhSkt0YXRhdGFINGF0YUg0YXRhcK7LCDCqzgt0YXRhdGFLdGF0YXRhS3RhdGFLdGF0YXCuyDQuNC70Lggwqs40YXRhdGF0YXRhdGF0YXRhdGF0YXCuyFcbiI7Cn0=