New URI Extension RFC
As an always-available part of PHP's standard library the new URI extension provides APIs to parse and modify URIs and URLs according to the RFC 3986 and the WHATWG URL standards.
The secure and standards-compliant URI parsing is powered by the uriparser (RFC 3986) and Lexbor (WHATWG URL) libraries.
Learn more about the backstory of this feature in The PHP Foundation’s blog.
$components = parse_url("https://php.net/releases/8.5/en.php");
var_dump($components['host']);
// string(7) "php.net"
use Uri\Rfc3986\Uri;
$uri = new Uri("https://php.net/releases/8.5/en.php");
var_dump($uri->getHost());
// string(7) "php.net"