Home  >  Article  >  Backend Development  >  Regular verification of mobile phone number problem

Regular verification of mobile phone number problem

WBOY
WBOYOriginal
2016-09-20 03:30:031018browse

if (!preg_match('/0?(00|01|11|13|14|15|17|18)[0-9]{9}/', $tel)) {

<code>    }
    
    </code>

Why does this regex allow mobile phone numbers with more than 11 digits to pass through directly without reporting an error? 00 and 01 11 are customized, just ignore them
The regex is not very good. What is wrong? How should I write it?

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn