php常用函数

 

 

//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 '非移动';

  

posted on 2015-10-27 09:46  Slege  阅读(89)  评论(0编辑  收藏  举报

导航