匹配移动联通电信手机号码正则表达式

<?php
$phone = "15332340997";
//移动
$yidong = "/^1(3[4-9]|47|5[012789]|78|8[23478])\d{8}$/";
//联通
$liantong = "/^1(3[0-2]|5[56]|8[56]|76)\d{8}$/";
//电信
$dianxin = "/^1(33|53|8[019]|77)\d{8}$/";
var_dump(preg_match($dianxin, $phone));

?>
文 / admin
LEAVE A REPLY

loading