日期:2014-05-17 浏览次数:20411 次
<?php
$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);