Table of Contents

getHost

API Package Subpackage Class Method Reference Last reviewed Doc status
API Home Package Joomla.Framework Subpackage Environment Class JURI Method getHost Reference getHost() Never Work in Progress

Gets the URI host. This function returns the hostname/ip, or null if no hostname/ip was specified.

Syntax

string getHost ()

Examples

Example

$uri = new JURI( 'http://forum.joomla.org/index.php/topic,41464.msg227819.html#msg227819' );
echo "Host: " . $uri->getHost();

might produce:

Result

Host: forum.joomla.org