phasync
Uri / withHost

Method

Uri::withHost

Returns a copy of the URI with the host replaced; '' removes it.

Description#

public Uri::withHost(
    $host
): UriInterface

Parameters#

$host

Return values#

UriInterface

Errors / Exceptions#

ExceptionWhen
InvalidArgumentExceptionWhen $host is not a string, or not a host name or IP address

See also#

  • Psr\Http\Message\UriInterface::withHost