日期:2014-05-16 浏览次数:20510 次
echo preg_replace('/(?<=.{3}).+@/', '*@', 'username@mail.net');use*@mail.net
$str ="12q2345qqqq667@qq.com";
$sub = substr($str, 2,strpos($str,'@') -2);
$len = strlen($sub);
$replaceStr = str_repeat('*',$len);
$newStr = str_replace($sub, $replaceStr, $str);
var_dump($newStr);