Skip to content
This repository was archived by the owner on Oct 8, 2022. It is now read-only.

Enrise/UriHelper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Archived and unmaintained

This is an old repository that is no longer used or maintained. We advice to no longer use this repository.

Original README can be found below:

UriHelper

Build Status


A simple URI helper class with implementations of the following RFC's / STD's:

Usage

$uri = new \Enrise\Uri('http://usr:[email protected]:81/mypath/myfile.html?a=b&b[]=2&b[]=3#myfragment');
echo $uri->getScheme(); // http
echo $uri->getUser(); // usr
echo $uri->getPass(); // pss
echo $uri->getHost(); // example.com
echo $uri->getPort(); // 81
echo $uri->getPath(); // /mypath/myfile.html
echo $uri->getQuery(); // a=b&b[]=2&b[]=3
echo $uri->getFragment(); // myfragment
echo $uri->isSchemeless(); // false
echo $uri->isRelative(); // false

$uri->setScheme('scheme:child:scheme.VALIDscheme123:');
$uri->setPort(null);

echo $uri->getUri(); // scheme:child:scheme.VALIDscheme123:usr:[email protected]/mypath/myfile.html?a=b&b[]=2&b[]=3#myfragment
use \Enrise\Uri;

$uri = new Uri('/relative/url.html');
echo $uri->getScheme(); // null
echo $uri->getHost(); // null
echo $uri->getPath(); // /relative/url.html
echo $uri->isSchemeless(); // true
echo $uri->isRelative(); // true

About

A general URI helper class for PHP.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages