public static function is_mobile()
    {
        if (!isset($_SERVER['HTTP_ACCEPT'])) {
            return false;
        }

        $accept = $_SERVER['HTTP_ACCEPT'];

        if (isset($_SERVER['HTTP_X_WAP_PROFILE']) || isset($_SERVER['HTTP_PROFILE']))
        {
            return true;
        }
        elseif (strpos($accept, 'text/vnd.wap.wml') > 0 || strpos($accept, 'application/vnd.wap.xhtml+xml') > 0)
        {
            return true;
        }
        else
        {
            foreach (array_keys(self::$devices) as $device)
            {
                if (self::is_device($device)) return true;
            }
        }
        return false;
    }