Table of Contents

setHost

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

Sets the URI host.

Syntax

void setHost ( $host )

$host string is a string containing the new URI host.

Examples

Example

$uri = new JURI( 'http://www.joomla.org?action=help#create' );
echo "Before: " . $uri->toString();
$uri->setHost( 'dev.joomla.org' );
echo "After: " . $uri->toString();

might produce:

Result

Before: http://www.joomla.org?action=help#create
After: http://dev.joomla.org?action=help#create