展示
123456789@iccao.com → 1234*****@iccao.com
PHP代码:
<?php
$email = $_user['email'];//这是邮箱,指定要修改
$em = explode("@",$email);
$name = $em[0];
$len = strlen($name);
$showLen = floor($len/2);
$str_arr = str_split($name);
for($ii=$showLen;$ii<$len;$ii++){
$str_arr[$ii] = '*';
}
$em[0] = implode('',$str_arr);
$new_name = implode('@',$em);
echo $new_name;?>