Actions

JURI/getHost

From Joomla! Documentation

Revision as of 10:33, 9 August 2012 by JoomlaWikiBot (Talk | contribs)

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