欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

php利用正则表达式实现手机号码格式验证代码

shiping1 的头像
if(preg_match("/^13[0-9]{1}[0-9]{8}$|15[0189]{1}[0-9]{8}$|189[0-9]{8}$/",$mobilephone)){   
    //验证通过   
        
}else{   
    //手机号码格式不对   
        
}


好像下面这个也是对的
'/^1[3458][0-9]{9}$/'
普通分类: