时间:2021-07-01 10:21:17 帮助过:2人阅读
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);