public static function hasEmoji($str) { $text = json_encode($str); //暴露出unicode return preg_match("/(\\\u[ed][0-9a-f]{3})/i", $text); }