打赏

手机号中间四位转*号

/**
     * 手机号中间四位转*号
     * @param $tel 手机号码
     * @return mixed
     */
    public function mobile_change($tel){
        $str = substr($tel,0,3);
        $strs = substr($tel,0,4);
        if ($str == '+86'){
            $tel_sub = substr($tel,3,11);
        }elseif ($strs == '+852' || $strs == '+853' || $strs == '+886'){
            $tel_sub = substr($tel,4,11);
        }
        return substr_replace($tel_sub, '****', 3, 4);
    }

 

posted on 2018-06-07 18:01  头大的冯冯  阅读(167)  评论(0编辑  收藏  举报

导航