Uri\WhatWg\Url::withHost
En esta página
Uri\WhatWg\Url::withHost
Modifica el componente de host
Descripción#
public Uri\WhatWg\Url::withHost(string $host): static
```php
Crea una nueva URL y modifica su componente de host.
## Parámetros
`host`
Nuevo componente de host.
## Valores devueltos
La instancia de `Uri\WhatWg\Url` modificada.
## Errores/Excepciones
Si la URL resultante es inválida, se lanza una excepción Uri\WhatWg\InvalidUrlException.
## Ejemplos
Ejemplo básico de Uri\WhatWg\Url::withHost
```php
El ejemplo anterior mostrará:
example.net
Véase también#
Uri\WhatWg\Url::getAsciiHost
Uri\WhatWg\Url::getUnicodeHost
Uri\Rfc3986\Uri::withHost