/** * 测试的例子 */ function test() { //风信jeff加个笑脸表情 $str = "%E9%A3%8E%E4%BF%A1Jeff%F0%9F%98%99%F0%9F%98%9B%F0%9F%98%9C%F0%9F%98%99"; $str = urldecode($str); echo emoji_to_string($str); }
public static function removeEmoji($content, $replaceStr = ':)') { //[\ud83c\udc00-\ud83c\udfff]|[\ud83d\udc00-\ud83d\udfff]|[\u2600-\u27ff] // return preg_replace('/\\\ue[0-9a-f]{3}/ie', '', $content); return emoji_to_string($content, $replaceStr); }