Since you seem to be using this for verification, you can use str_replace('[\s\+\-\(\)]', '', $data) to get a string that should (if the phone number is valid) contain only numbers. You can easily verify this assumption by doing preg_match('\d{11}', $data) ( {11} means 11 digits, if the valid range, use min, max, like this {min,max} , like \d{10,11} ).
It is worth noting that this is not as thorough as Lorlin responds by ignoring any illegal use of brackets, + or - s. You might want to use a combination of two or any other that best suits your needs.
source share