Back to Browser class

Method getHTTPProtocol

public string
getHTTPProtocol
()
Returns the server protocol in use on the current server.
Returns
  • string The HTTP server protocol version.
Since
  • 1.7.0
Class: Browser
Project: Joomla

Method getHTTPProtocol - Source code

/**
 * Returns the server protocol in use on the current server.
 *
 * @return  string  The HTTP server protocol version.
 *
 * @since   1.7.0
 */
public function getHTTPProtocol()
{
    if (isset($_SERVER['SERVER_PROTOCOL'])) {
        if ($pos = strrpos($_SERVER['SERVER_PROTOCOL'], '/')) {
            return substr($_SERVER['SERVER_PROTOCOL'], $pos + 1);
        }
    }
}