$phone
=
"(021)423-2323"
;
if
(preg_match(
'/\(?\d{3}\)?[-\s.]?\d{3}[-\s.]\d{4}/x'
,
)) {
echo
"Your phone number is ok."
}
else
{
"Wrong phone number."