您的位置:首页 > 编程语言 > PHP开发

php 正则判断是否是手机号码

2016-11-01 15:23 369 查看
$phonenumber = '13712345678';
if(preg_match("/^1[34578]{1}\d{9}$/",$phonenumber)){
echo "是手机号码";
}else{
echo "不是手机号码";
}

"^"匹配文本的开头,"$"匹配文本的结尾。

引用:http://blog.csdn.net/macwhirr123/article/details/11897325
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: