Created
July 31, 2017 14:25
-
-
Save JellyBool/8e445784af39e9ef30b05f232b6402d8 to your computer and use it in GitHub Desktop.
手机号正则
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function passes($attribute, $value) | |
{ | |
return preg_match('/^(13[0-9]|14[579]|15[0-3,5-9]|17[0135678]|18[0-9])\\d{8}$/',$value); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment