src/Request.php
public function getHost() {
		if (!is_null($this->host)) {
			return $this->host;
		}

		if ($_SERVER['HTTP_X_FORWARDED_HOST']) {
			$elements = explode(',', $value);
			$host = trim(end($elements));
		} else if ($_SERVER['HTTP_HOST']) {
			$host = $_SERVER['HTTP_HOST'];
		} else if ($_SERVER['SERVER_NAME']) {
			$host = $_SERVER['SERVER_NAME'];
		}

		if (isset($host)) {
			$host = preg_replace('/:\d+$/', '', $host);
			$this->host = $host;
		}

		return $this->host;
	}
public function getHost() {
		if (!is_null($this->host)) {
			return $this->host;
		}

		if ($_SERVER['HTTP_X_FORWARDED_HOST']) {
			$elements = explode(',', $value);
			$host = trim(end($elements));
		} else if ($_SERVER['HTTP_HOST']) {
			$host = $_SERVER['HTTP_HOST'];
		} else if ($_SERVER['SERVER_NAME']) {
			$host = $_SERVER['SERVER_NAME'];
		}

		if (isset($host)) {
			$host = preg_replace('/:\d+$/', '', $host);
			$this->host = $host;
		}

		return $this->host;
	}
public function getHost ( ) { if ( ! is_null ( $ this -> host ) ) { return $ this -> host ; } if ( $ _SERVER [ 'HTTP_X_FORWARDED_HOST' ] ) { $ elements = explode ( ',' , $ value ) ; $ host = trim ( end ( $ elements ) ) ; } else if ( $ _SERVER [ 'HTTP_HOST' ] ) { $ host = $ _SERVER [ 'HTTP_HOST' ] ; } else if ( $ _SERVER [ 'SERVER_NAME' ] ) { $ host = $ _SERVER [ 'SERVER_NAME' ] ; } if ( isset ( $ host ) ) { $ host = preg_replace ( '/:\d+$/' , '' , $ host ) ; $ this -> host = $ host ; } return $ this -> host ; }
Get HTTP host.

@return string
Get HTTP host .