Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/castor-labs/uri
RFC 3986 compliant URI value object for PHP
https://github.com/castor-labs/uri
composer-library php php7 querystring querystring-parser rfc3986 uri url
Last synced: 6 days ago
JSON representation
RFC 3986 compliant URI value object for PHP
- Host: GitHub
- URL: https://github.com/castor-labs/uri
- Owner: castor-labs
- License: bsd-3-clause
- Created: 2021-07-07T12:25:04.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-10-13T00:22:15.000Z (about 2 years ago)
- Last Synced: 2024-11-05T02:42:41.567Z (about 2 months ago)
- Topics: composer-library, php, php7, querystring, querystring-parser, rfc3986, uri, url
- Language: PHP
- Homepage:
- Size: 91.8 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
Castor Uri
==========![php-workflow](https://github.com/castor-labs/uri/actions/workflows/php.yml/badge.svg?branch=main)
![code-coverage](https://img.shields.io/badge/Coverage-84%25-yellow.svg?longCache=true&style=flat)RFC 3986 compliant URI value object.
## Installation
You can install the latest stable version with:
```bash
composer require castor/uri
```## Quick Start
```php
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](https://castor-labs.github.io/docs/packages/uri/intro.html).