castor / uri
RFC 3986 compliant URI value object
Installs: 107
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 1
Open Issues: 0
pkg:composer/castor/uri
Requires
- php: >=8.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.11
- phpunit/phpunit: ^9.5
- vimeo/psalm: ^4.27
README
RFC 3986 compliant URI value object.
Installation
You can install the latest stable version with:
composer require castor/uri
Quick Start
<?php use Castor\Net\Uri; $uri = Uri::parse('https://example.com/hello?foo=bar'); echo $uri->getScheme(); // Prints: https echo $uri->getHost(); // Prints: example.com echo $uri->getPath(); // Prints: /hello echo $uri->getRawQuery(); // Prints: foo=bar echo $uri->getQuery()->add('foo', 'foo')->encode(); // Prints: foo=bar&foo=foo
To learn about the rationale behind this library, best practices when using it and implementation examples, check the documentation.