phpyk
9/13/2018 - 9:03 AM

检测字符串中是否包含emoji表情

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