sanmai / parsed-url
Object-oriented interface to parse_url/parse_str
Fund package maintenance!
sanmai
v1.0.4
2024-02-17 10:09 UTC
Requires
- php: >=7.4
Requires (Dev)
- friendsofphp/php-cs-fixer: >2.16
- php-coveralls/php-coveralls: ^2.0
- sanmai/phpunit-legacy-adapter: ^6 || ^8
README
Install
composer require sanmai/parsed-url
Use
$url = new \ParsedUrl\ParsedUrl('https://www.example.com/index.html?foo=bar&baz=1'); var_dump($url->scheme); // string(5) "https" var_dump($url->host); // string(15) "www.example.com" var_dump($url->path); // "/index.html" var_dump($url->query); // string(13) "foo=bar&baz=1" var_dump($url->query()->foo); // string(3) "bar"