当前位置:网站首页>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; }
边栏推荐
- Rocky basic command 3
- zabbix 监控
- 【MySQL 使用秘籍】一網打盡 MySQL 時間和日期類型與相關操作函數(三)
- ELK 企业级日志分析系统
- 49. Grouping of alphabetic ectopic words: give you a string array, please combine the alphabetic ectopic words together. You can return a list of results in any order. An alphabetic ectopic word is a
- [MySQL usage Script] catch all MySQL time and date types and related operation functions (3)
- What about data leakage? " Watson k'7 moves to eliminate security threats
- Idea remote debugging agent
- leetcode 10. Regular Expression Matching 正则表达式匹配 (困难)
- leetcode 10. Regular expression matching regular expression matching (difficult)
猜你喜欢
Solve the problem of invalid uni app configuration page and tabbar
NFT value and white paper acquisition
French scholars: the explicability of counter attack under optimal transmission theory
Laravel框架运行报错:No application encryption key has been specified
Internal JSON-RPC error. {"code":-32000, "message": "execution reverted"} solve the error
Aikesheng sqle audit tool successfully completed the evaluation of "SQL quality management platform grading ability" of the Academy of communications and communications
Operational research 68 | the latest impact factors in 2022 were officially released. Changes in journals in the field of rapid care
redis6主从复制及集群
How to deal with the Yellow Icon during the installation of wampserver
Win10——轻量级小工具
随机推荐
"Baidu Cup" CTF competition in September, web:upload
FPGA learning notes: vivado 2019.1 add IP MicroBlaze
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.
Scientific running robot pancakeswap clip robot latest detailed tutorial
leetcode 10. Regular Expression Matching 正则表达式匹配 (困难)
如何把大的‘tar‘存档文件分割成特定大小的多个文件
Win10——轻量级小工具
go map
How to deal with the Yellow Icon during the installation of wampserver
【 script secret pour l'utilisation de MySQL 】 un jeu en ligne sur l'heure et le type de date de MySQL et les fonctions d'exploitation connexes (3)
redis6数据类型及操作总结
不知道这4种缓存模式,敢说懂缓存吗?
Record in-depth learning - some bug handling
go 字符串操作
A detailed explanation of ASCII code, Unicode and UTF-8
mysql获得时间
Basic characteristics and isolation level of transactions
Talk about seven ways to realize asynchronous programming
[server data recovery] a case of RAID5 data recovery stored in a brand of server
Laravel framework operation error: no application encryption key has been specified