The League of Extraordinary Packages

Our Packages:

Presented by The League of Extraordinary Packages


Modern API to process URI in PHP.

$ composer require league/uri



use League\Uri\Modifiers\MergeQuery;
use League\Uri\Schemes\Http as HttpUri;

$base_uri = "";
$query_to_merge = 'fo.o=bar&taz=';

$uri = HttpUri::createFromString($base_uri);
$modifier = new MergeQuery($query_to_merge);

$new_uri = $modifier->process($uri);
echo $new_uri;
// display


The library provides simple and intuitive classes to parse, validate, format and manipulate URIs and their components. It is built to enable working with any kind of RFC3986 compliant URI through extensions and middlewares.

  1. Simple and extensible API

  2. RFC3986 compliant

  3. Implements PSR-7 UriInterface interface

  4. Framework-agnostic


Current Stable Release

League\Uri 5.0

  • Requires: PHP >= 7.0.0
  • Release Date: 2017-02-06
  • Supported Until: TBD

Full Documentation

Old stable release

League\Uri 4.0

  • Requires: PHP >= 5.5.9
  • Release Date: 2015-09-23
  • Supported Until: 2017-08-06

Full Documentation

Once a new major version is released, the previous stable release remains supported for six (6) more months through patches and/or security fixes.


League\Uri was created by Ignace Nyamagana Butera. Find him on Twitter at @nyamsprod.