public static function removeemoji($text) { $clean_text = ; // match emoticons $regexemoticons = '/[\x{1f600}-\x{1f64f}]/u'; $clean_text = preg_replace($regexemoticons, '', $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;}
参考地址:
http://stackoverflow.com/questions/12807176/php-writing-a-simple-removeemoji-function
以上就介绍了移除emoji内容,包括了方面的内容,希望对php教程有兴趣的朋友有所帮助。