Skip to content

Uri: getHost Example

Terry L edited this page Jun 20, 2020 · 3 revisions
Clone this wiki locally

Shieldon\Psr7\Uri

getHost()

Retrieve the host component of the URI.

  • return string

Example:

$uri = new \Shieldon\Psr7\Uri(
    'https://terry:1234@example.com:8888/phpMyAdmin/'
);

echo $uri->getHost();
// Outputs: example.com