<?php 
$text = "+8-(050)-934 ";
$regexp = '/^8[0-9]{10}$/';
$text = str_replace(" ", "", $text);
$text = str_replace("+", "", $text);
$text = str_replace("-", "", $text);
$text = str_replace("(", "", $text);
$text = str_replace(")", "", $text);

if (preg_match($regexp, $text)){
	echo "Всё правильно";
} else {
	echo "Ошибка";
}
