UTILITY

url_host()

Extract the host component of a URL.

Signature

mixed url_host(string $url, mixed $default = null)

Example

url_host('https://example.com/docs'); // 'example.com'

Available from: 1.5.0

Reference navigation

Previous: unique()

Next: url_path()

Back to utilities