API16

JBrowser/getHTTPProtocol: Difference between revisions

From Joomla! Documentation

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|...
 
m preparing for archive only
 
(2 intermediate revisions by the same user not shown)
Line 2: Line 2:
Returns the server protocol in use on the current server.
Returns the server protocol in use on the current server.


<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[Description:JBrowser/getHTTPProtocol|Edit Descripton]]<nowiki>]</nowiki>
</span>


{{Description:JBrowser/getHTTPProtocol}}
 
<! removed transcluded page call, red link never existed >


===Syntax===
===Syntax===
Line 33: Line 31:
</source>
</source>


<span class="editsection" style="font-size:76%;">
 
<nowiki>[</nowiki>[[SeeAlso:JBrowser/getHTTPProtocol|Edit See Also]]<nowiki>]</nowiki>
<! removed transcluded page call, red link never existed >
</span>
{{SeeAlso:JBrowser/getHTTPProtocol}}


===Examples===
===Examples===
<CodeExamplesForm />
=== Code Examples ===
<dpl>
<dpl>
  noresultsheader=\n
  noresultsheader=\n
  category=getHTTPProtocol
  category=getHTTPProtocol
  category=JBrowser
  category=JBrowser
  category=CodeExample
  namespace=CodeExample
  category=MethodExample
  category=MethodExample
  include=*
  include=*
  format= ,,,
  format= ,,,
</dpl>
</dpl>
[[Category:Archived pages API16]]

Latest revision as of 01:19, 25 March 2017

Description

Returns the server protocol in use on the current server.


<! removed transcluded page call, red link never existed >

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;
}


<! removed transcluded page call, red link never existed >

Examples

Code Examples