PHP processing method for filtering special symbols of WeChat nicknames
纳尼
纳尼 2023-06-14 22:12:28
0
1
453

preg_replace("/[\x{1F600}-\x{1F64F}\x{1F300}-\x{1F5FF}\x{1F680}-\x{1F6FF}\x{2600}-\x{ 26FF}\x{2700}-\x{27BF}]/u","","This is the nickname")

https://xmy.xingzs.top/

纳尼
纳尼

reply all (1)
WBOY
function filterSpecialChars($nickname) { $pattern = '/[^\p{L}\p{N}\s]/u'; $filteredNickname = preg_replace($pattern, '', $nickname); return $filteredNickname; }
$nickname = "微信昵称@#特殊字符"; $filteredNickname = filterSpecialChars($nickname); echo $filteredNickname; // 输出:微信昵称特殊字符

    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!