The League of Extraordinary Packages

Our Packages:

Presented by The League of Extraordinary Packages

URI

Modern API to process URI in PHP.

$ composer require league/uri

Usage

<?php

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

$base_uri = "http://www.example.com?fo.o=toto#~typo";
$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 http://www.example.com?fo.o=bar&taz=#~typo

Highlights

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

Releases

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.

Questions?

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