时间:2021-07-01 10:21:17 帮助过:23人阅读
echo preg_replace('/(?<=.{3}).+@/', '*@', [email protected]');[email protected]
$str ="[email protected]";
$sub = substr($str, 2,strpos($str,'@') -2);
$len = strlen($sub);
$replaceStr = str_repeat('*',$len);
$newStr = str_replace($sub, $replaceStr, $str);
var_dump($newStr);