当前位置:网站首页>Hide Chinese name
Hide Chinese name
2022-07-05 13:43:00 【Php_ XiaoZhi】
/** * Only the first and last characters of the string are reserved , Hide intermediate use * Instead of ( Only the first one is displayed when there are two characters ) * @param string $user_name full name * @return string Formatted name */ function substr_cut($user_name){ $strlen = mb_strlen($user_name, 'utf-8'); $firstStr = mb_substr($user_name, 0, 1, 'utf-8'); $lastStr = mb_substr($user_name, -1, 1, 'utf-8'); return $strlen == 2 ? $firstStr . str_repeat('*', mb_strlen($user_name, 'utf-8') - 1) : $firstStr . str_repeat("*", $strlen - 2) . $lastStr; }
边栏推荐
- leetcode 10. Regular Expression Matching 正则表达式匹配 (困难)
- Get you started with Apache pseudo static configuration
- Don't know these four caching modes, dare you say you understand caching?
- Backup and restore of Android local SQLite database
- French scholars: the explicability of counter attack under optimal transmission theory
- zabbix 监控
- Kotlin协程利用CoroutineContext实现网络请求失败后重试逻辑
- C object storage
- 真正的缓存之王,Google Guava 只是弟弟
- Matlab paper chart standard format output (dry goods)
猜你喜欢
Write API documents first or code first?
A detailed explanation of ASCII code, Unicode and UTF-8
What about data leakage? " Watson k'7 moves to eliminate security threats
嵌入式软件架构设计-消息交互
Idea remote debugging agent
山东大学暑期实训一20220620
Laravel框架运行报错:No application encryption key has been specified
【华南理工大学】考研初试复试资料分享
About the problem and solution of 403 error in wampserver
[public class preview]: basis and practice of video quality evaluation
随机推荐
Kotlin协程利用CoroutineContext实现网络请求失败后重试逻辑
Idea remote debugging agent
这18个网站能让你的页面背景炫酷起来
French scholars: the explicability of counter attack under optimal transmission theory
53. Maximum subarray sum: give you an integer array num, please find a continuous subarray with the maximum sum (the subarray contains at least one element) and return its maximum sum.
go 指针
Fragmented knowledge management tool memos
go 字符串操作
Laravel framework operation error: no application encryption key has been specified
[notes of in-depth study paper]transbtsv2: wider instead of deep transformer for medical image segmentation
Scientific running robot pancakeswap clip robot latest detailed tutorial
运筹说 第68期|2022年最新影响因子正式发布 快看管科领域期刊的变化
[public class preview]: basis and practice of video quality evaluation
asp.net 读取txt文件
私有地址有那些
Go string operation
The "Baidu Cup" CTF competition was held in February 2017, Web: explosion-2
TortoiseSVN使用情形、安装与使用
ZABBIX monitoring
Operational research 68 | the latest impact factors in 2022 were officially released. Changes in journals in the field of rapid care