API16

API16:JBrowser/getHTTPProtocol

From Joomla! Documentation

Revision as of 22:46, 22 March 2010 by Doxiki (talk | contribs) (New page: ===Description=== Returns the server protocol in use on the current server. <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>[[Description:JBrowser/getHTTPProtocol|...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Description

Returns the server protocol in use on the current server.

[Edit Descripton]

Template:Description:JBrowser/getHTTPProtocol

Syntax

getHTTPProtocol()


Returns

string The HTTP server protocol version.

Defined in

libraries/joomla/environment/browser.php

Importing

jimport( 'joomla.environment.browser' );

Source Body

public function getHTTPProtocol()
{
        if (isset($_SERVER['SERVER_PROTOCOL'])) {
                if (($pos = strrpos($_SERVER['SERVER_PROTOCOL'], '/'))) {
                        return substr($_SERVER['SERVER_PROTOCOL'], $pos + 1);
                }
        }
        return null;
}

[Edit See Also] Template:SeeAlso:JBrowser/getHTTPProtocol

Examples

<CodeExamplesForm />