600字范文,内容丰富有趣,生活中的好帮手!
600字范文 > PHP存储微信昵称特殊符号过滤方法

PHP存储微信昵称特殊符号过滤方法

时间:2020-05-24 09:34:26

相关推荐

PHP存储微信昵称特殊符号过滤方法

在此做一下记录

protected function removeEmoji($clean_text) {// Match Emoticons$regexEmoticons = '/[\x{1F600}-\x{1F64F}]/u';$clean_text = preg_replace($regexEmoticons, '', $clean_text);// Match Miscellaneous Symbols and Pictographs$regexSymbols = '/[\x{1F300}-\x{1F5FF}]/u';$clean_text = preg_replace($regexSymbols, '', $clean_text);// Match Transport And Map Symbols$regexTransport = '/[\x{1F680}-\x{1F6FF}]/u';$clean_text = preg_replace($regexTransport, '', $clean_text);// Match Miscellaneous Symbols$regexMisc = '/[\x{2600}-\x{26FF}]/u';$clean_text = preg_replace($regexMisc, '', $clean_text);// Match Dingbats$regexDingbats = '/[\x{2700}-\x{27BF}]/u';$clean_text = preg_replace($regexDingbats, '', $clean_text);return $clean_text;}

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。