时间:2021-07-01 10:21:17 帮助过:141人阅读
$str ='tt扣分金锡民s';
function hide_repalce($str, $code='utf-8') {
mb_internal_encoding($code);
$len = mb_strlen($str);
return mb_substr($str, 0, 1) . str_repeat('*', $len - 2) . mb_substr($str, $len - 1, 1);
}
echo hide_repalce($str);