cyve/url

URL manipulation

Maintainers

Details

github.com/cyve/url

Source

Issues

Installs: 473

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/cyve/url

2.0.0 2024-07-26 13:19 UTC

This package is auto-updated.

Last update: 2025-09-26 16:01:29 UTC


README

URL manipulation

Installation

$ composer require cyve/url

Usage

use Cyve\Url\Url;

$url = new Url('https://user:pwd@www.domain.tld:8080/foo/bar?key=value#hash');

echo $url->scheme; // https
echo $url->username; // user
echo $url->password; // pwd
echo $url->host; // www.domain.tld
echo $url->subDomain; // www
echo $url->domain; // domain.tld
echo $url->tld; // tld
echo $url->port; // 8080
echo $url->path; // /foo/bar
echo $url->path[0]; // foo
echo $url->path[1]; // bar
echo $url->query; // key=value
echo $url->query->get('key'); // value
echo $url->query->get('undefined', 'default'); // default
echo $url->fragment; // hash