最新版手机号校验函数 兼容19开头的
- function ismobile($mobile)
- {
- return (strlen($mobile) == 11) && (preg_match("/^13\d{9}$/", $mobile) || preg_match("/^14\d{9}$/", $mobile) || preg_match("/^15\d{9}$/", $mobile) || preg_match("/^16\d{9}$/", $mobile) || preg_match("/^17\d{9}$/", $mobile) || preg_match("/^18\d{9}$/", $mobile) || preg_match("/^19\d{9}$/", $mobile));
- }
复制代码 |