The League of Extraordinary Packages

Our Packages:

Presented by The League of Extraordinary Packages

Getting Started

Uri functions

Uri parser

Uri schemes

Uri manipulations

Uri components

Uri Domain Parser

Upgrading Guide

Generic URIs

Starting with version 1.1.0 all URI objects are defined in the League\Uri namespace. The League\Uri\Schemes namespace is deprecated and will be removed in the next major release.

available since version 1.1.0

A generic URI object League\Uri\Uri is introduced to represent any RFC3986 compatible URI. This URI object wil only validate RFC3986 rules so depending on the URI scheme the returned URI may not be valid.


use League\Uri\Uri;
use League\Uri\Ws;

$ws_uri = 'wss://';

$uri = Uri::createFromString($ws_uri);
//this will not throw an error because this URI satified RFC3986 rules
$uribis = Ws::createFromString($ws_uri);
//this will throw an exception because the URI contains a fragment which is forbidden
//for websocket URI