php 邮箱替换*

    $emailArr = explode("@",$email);
        if($emailArr[0]){
            if($emailArr[0]>3){
                $leng=3;
            }else{
                $leng=1;
            }
            for ($i=0;$i<(strlen($emailArr[0])-$leng);$i++){
                $stars.="*";
            }
            $email=substr_replace($emailArr[0],$stars,$leng).$emailArr[1];
        }

 

posted on 2015-03-05 10:37  一条大鱼  阅读(172)  评论(0编辑  收藏  举报