There is no license information available for the latest version (1.0) of this package.

1.0 2020-02-06 05:59 UTC

This package is not auto-updated.

Last update: 2024-04-27 02:06:03 UTC


README

Install

composer require chemisus/uri

Examples

$uri = uri("http://example.com:8080/hello?name=chemisus");
echo $uri->scheme();        # http
echo $uri->host();          # example.com
echo $uri->port();          # 8080
echo $uri->authority();     # example.com:8080
echo $uri->path();          # /hello
echo $uri->query();         # name=chemisus
echo $uri;                  # http://example.com:8080/hello?name=chemisus

$child = $uri->with([
    URI::SCHEME => 'https',
    URI::PORT => null,
    URI::PATH => '/hello/world'
]);
echo $child->scheme();      # https
echo $child->host();        # example.com
echo $child->port();        # 
echo $child->authority();   # example.com
echo $child->path();        # /hello/world
echo $child->query();       # name=chemisus
echo $child;                # https://example.com/hello/world?name=chemisus