Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
You can check only the first couple of digits, everything else can be anything.
https://www.regextester.com/94215
So +79991111111 is a very real number, like +79999999999
The maximum that can be done is to check for the same characters in the number, if at all the entire number consists of one digit, then draw conclusions.
In general, if you really need to validate a number, send an SMS to it or dial it with a random number (although it seems already illegal in the Russian Federation, you can’t replace numbers with any) and ask for numbers.
if(count( array_unique( str_split( preg_replace("/[^0-9]/", "", $_POST['tel']) ))) > 4) {
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question