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