//preg_match(pattern, str)对串str进行pattern的正则匹配 $num = '18712345678'; $pattren = "/^(((13)[4-9]{1})|((15)[0,1,2,7,8,9]{1})|((18)[7,8]{1})|(147))[0-9]{8}$/"; if(preg_match($pattren, $num)) echo '移动'; else echo '非移动';
//preg_match(pattern, str)对串str进行pattern的正则匹配 $num = '18712345678'; $pattren = "/^(((13)[4-9]{1})|((15)[0,1,2,7,8,9]{1})|((18)[7,8]{1})|(147))[0-9]{8}$/"; if(preg_match($pattren, $num)) echo '移动'; else echo '非移动';