php验证手机号是否正确
时间:2014-08-26 11:46:16
收藏:0
阅读:297
if(!preg_match("/^13[0-9]{1}[0-9]{8}$|15[0-9]{1}[0-9]{8}$|18[0-9]{1}[0-9]{8}$|145[0-9]{8}$$/",$phone)){
echo "<script>alert(‘手机号不正确!‘)</script>";
echo "<script>location=‘register.php‘</script>";
exit;
}
echo "<script>alert(‘手机号不正确!‘)</script>";
echo "<script>location=‘register.php‘</script>";
exit;
}
原文:http://blog.csdn.net/huang_zhidong/article/details/38843837
评论(0)