手机号隐藏中间4位
$tel = substr_replace($tel,'****',3,4);
邮箱加星号
$arr = explode('@',"cfn@leapy.cn");
$email = mb_substr($arr[0],0,1)."***@".$arr[1];
echo $email;
身份证加星号
if (strlen($idcard) == 15) echo substr_replace($idcard,"*******",6,7);
elseif (strlen($idcard) == 18) echo substr_replace($idcard,"**********",6,10);
else echo "身份证格式不正确";