sanmai/parsed-url

This package is not installable via Composer 1.x, please make sure you upgrade to Composer 2+. Read more about our Composer 1.x deprecation policy.

Object-oriented interface to parse_url/parse_str

Fund package maintenance!
sanmai

v1.0.3 2021-01-02 09:38 UTC

This package is auto-updated.

Last update: 2021-12-01 00:20:27 UTC


README

Latest Stable Version Build Status Coverage Status

Install

composer require sanmai/parsed-url

The latest version requires PHP 7.0 or greater, including PHP 8.0+.

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"