feat(IndexController): 根据名字长度修改最后一位字符的处理方式
This commit is contained in:
parent
ccad640b86
commit
dd5a03ee65
@ -287,7 +287,7 @@ class IndexController extends BaseLikeController
|
||||
$lastStr = mb_substr($name, -1, 1); // 获取名字的最后一个字符
|
||||
$replaceStr = ''; // 初始化替换字符串
|
||||
if ($strlen == 2) {
|
||||
return $firstStr . $replaceStr;
|
||||
return $firstStr . '*';
|
||||
} else {
|
||||
for ($i = 0; $i < $strlen - 2; $i++) {
|
||||
$replaceStr .= '*'; // 根据需要替换的字符数量,生成相应数量的星号
|
||||
|
Loading…
x
Reference in New Issue
Block a user