Actions

Difference between revisions of "JURI/getHost"

From Joomla! Documentation

m (See also: re-categorisation)
m (Edit api.joomla.org link)
 
Line 13: Line 13:
 
  Host is www.example.com
 
  Host is www.example.com
 
===See also===
 
===See also===
* [http://api.joomla.org/Joomla-Framework/Environment/JURI.html#getHost JURI->getHost on api.joomla.org]
+
* [http://api.joomla.org/1.5/Joomla-Framework/Environment/JURI.html#getHost JURI->getHost on api.joomla.org]
 
* [[JURI/setHost|JURI->setHost]]
 
* [[JURI/setHost|JURI->setHost]]
 
<noinclude>[[Category:JURI]]</noinclude>
 
<noinclude>[[Category:JURI]]</noinclude>

Latest revision as of 11:34, 21 December 2012

Returns the host part of the URI represented by the JURI object.

Syntax

string getHost()

Example

$uri = 'http://fredbloggs:itsasecret@www.example.com:8080/path/to/Joomla/index.php?task=view&id=32#anchorthis';
$u =& JURI::getInstance( $uri );
echo 'Host is ' . $u->getHost();

would output

Host is www.example.com

See also