Actions

Difference between revisions of "JURI/getHost"

From Joomla! Documentation

(New page: Returns the host part of the URI represented by the JURI object. ===Syntax=== string getHost() ===Example=== <source lang="php"> $uri = 'http://fredbloggs:itsasecret@www.example.com:8080...)
 
m (See also: re-categorisation)
Line 15: Line 15:
 
* [http://api.joomla.org/Joomla-Framework/Environment/JURI.html#getHost JURI->getHost on api.joomla.org]
 
* [http://api.joomla.org/Joomla-Framework/Environment/JURI.html#getHost JURI->getHost on api.joomla.org]
 
* [[JURI/setHost|JURI->setHost]]
 
* [[JURI/setHost|JURI->setHost]]
<noinclude>[[Category:Development]][[Category:Framework]][[Category:JURI]]</noinclude>
+
<noinclude>[[Category:JURI]]</noinclude>

Revision as of 11:33, 9 August 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