Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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).