Please consider using the the latest stable version for any production code.

Uri Components

Build Status Latest Version

This package contains classes to help parsing and modifying URI components.

use League\Uri\Components\Query;
use League\Uri\Uri;
use League\Uri\UriModifier;

$uri = Uri::createFromString('');
$newUri = UriModifier::appendQuery($uri, 'q=new.Value');
echo $newUri; // '';

$query = Query::createFromUri($newUri);
$newQuery->get('q');    // returns 'value'
$newQuery->getAll('q'); // returns ['value', 'new.Value']
$newQuery->params('q'); // returns 'new.Value'

System Requirements

You need PHP >= 7.2 but the latest stable version of PHP is recommended

If you want to handle:

Trying to process such hosts without meeting those minimal requirements will trigger a RuntimeException.


$ composer require league/uri-components


What you will be able to do