If (! Preg_match (& #039; 0? (00 | 01 | 11 | 13 | 14 | 15 | 17 | 18) [0-9] {9} & #039;, $ tel )) {code ...} why can I use this regular expression for mobile phone numbers with more than 11 digits without reporting errors? 00 and 0111 are customized and ignored. the regular expression is not very good. Where can I write it wrong? How should I write it? if (! Preg_match ('/0? (00 | 01 | 11 | 13 | 14 | 15 | 17 | 18) [0-9] {9}/', $ tel )){
}
Why does this regular expression mean that mobile phone numbers with more than 11 digits will pass through without the error 00 and 01 11, which is a custom ignore?
The regular expression is not good. Where should I write it wrong? How should I write it?
Reply content:
If (! Preg_match ('/0? (00 | 01 | 11 | 13 | 14 | 15 | 17 | 18) [0-9] {9}/', $ tel )){
}
Why does this regular expression mean that mobile phone numbers with more than 11 digits will pass through without the error 00 and 01 11, which is a custom ignore?
The regular expression is not good. Where should I write it wrong? How should I write it?
Because you're useless ^... $ https://secure.php.net/manual...
Preg_match ('/^ (\ + 86 )? 1 [34578] \ d {9} $/', $ phone)