cyve / url
URL manipulation
Installs: 473
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/cyve/url
Requires
- php: ^8.0
- psr/http-message: ^2.0
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