脱敏优化
This commit is contained in:
+1
-5
@@ -123,11 +123,7 @@ class Util
|
||||
if(empty($str)){
|
||||
return '';
|
||||
}
|
||||
// 只对 11 位手机号进行脱敏,中间 4 位用 * 替换
|
||||
if (preg_match('/^1[3-9]\d{9}$/', $str)) {
|
||||
return substr($str, 0, 3) . '****' . substr($str, -4);
|
||||
}
|
||||
return $str;
|
||||
return substr($str, 0, 3) . '****' . substr($str, -4);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user