crwlr / url
Swiss Army knife for URLs.
Installs: 40 610
Dependents: 2
Suggesters: 0
Security: 0
Stars: 104
Watchers: 2
Forks: 7
Open Issues: 0
Requires
- php: ^8.0
- crwlr/query-string: ^1.0
- psr/http-message: ^1.0 || ^2.0
- symfony/polyfill-intl-idn: ^1.11
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.4
- pestphp/pest: ^1.22|^2.0|^3.0
- pestphp/pest-plugin-parallel: ^1.2
- phpstan/phpstan: ^1.8
This package is auto-updated.
Last update: 2024-11-06 00:49:11 UTC
README
A Swiss Army knife for URLs
This package is for you when PHP's parse_url() is not enough.
Key Features:
- Parse a URL and access or modify all its components separately.
- Resolve any relative reference you may find in an HTML document to an absolute URL, based on the document's URL.
- Get not only the full host of a URL, but also the registrable domain, the domain suffix and the subdomain parts of the host separately (Thanks to the Mozilla Public Suffix List).
- An advanced API to access and manipulate the URL query component.
- Compare URLs or components of URLs (e.g. checking if different URLs point to the same host or domain)
- Thanks to symfony/polyfill-intl-idn it's also no problem to parse internationalized domain names (IDN).
- Includes an adapter class which implements the PSR-7 UriInterface.
Documentation
You can find the documentation at crwlr.software.
Contributing
If you consider contributing something to this package, read the contribution guide (CONTRIBUTING.md).