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

  • 内容
  • 评论
  • 相关
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;
    }

本文标签:

版权声明:若无特殊注明,本文皆为《菜鸟站长》原创,转载请保留文章出处。

本文链接:PHP存储微信昵称特殊符号过滤方法 - http://wlphp.com/?post=303

发表评论

电子邮件地址不会被公开。 必填项已用*标注

福利广告

Fatal error: Uncaught exception 'RedisException' with message 'WRONGPASS invalid username-password pair' in /www/wwwroot/www.wlphp.com/content/templates/FLY/footer.php:264 Stack trace: #0 /www/wwwroot/www.wlphp.com/content/templates/FLY/footer.php(264): Redis->auth('Bsgj0711!') #1 /www/wwwroot/www.wlphp.com/content/templates/FLY/echo_log.php(133): include('/www/wwwroot/ww...') #2 /www/wwwroot/www.wlphp.com/include/controller/log_controller.php(105): include('/www/wwwroot/ww...') #3 /www/wwwroot/www.wlphp.com/include/lib/dispatcher.php(77): Log_Controller->displayContent(Array) #4 /www/wwwroot/www.wlphp.com/index.php(13): Dispatcher->dispatch() #5 {main} thrown in /www/wwwroot/www.wlphp.com/content/templates/FLY/footer.php on line 264