ParsedUri
class ParsedUri
A RFC3986 compliant URI parser
Constants
URI_REGEX |
|
Methods
Constructor for creating a new parsed URI
Returns true if this is an absolute (complete) URI
Returns true if this is an relative (partial) URI
Returns the scheme of the URI (e.g. http)
Sets the scheme of the URI (e.g. http)
Returns the authority of the URI (e.g. www.example.com:8080)
Sets the authority of the URI (e.g. www.example.com:8080)
Returns the path of the URI (e.g. /foo/bar)
Set the path of the URI (e.g. /foo/bar)
Returns the query string part of the URI (e.g. foo=bar)
Set the query string of the URI (e.g. foo=bar)
Returns the fragment part of the URI (i.e. after the #)
Set the fragment of the URI (i.e. after the #)
Resolves a relative URI using this URI as the base URI.
Convert the parsed URI back into a string
Magic method to convert the URI, when casted, back to a string
Details
at line 69
__construct(mixed $uri = null)
Constructor for creating a new parsed URI
The $uri parameter can either be a string or an associative array with the following keys: scheme, authority, path, query, fragment
at line 100
bool
isAbsolute()
Returns true if this is an absolute (complete) URI
at line 108
bool
isRelative()
Returns true if this is an relative (partial) URI
at line 116
string
getScheme()
Returns the scheme of the URI (e.g. http)
at line 124
setScheme(string $scheme)
Sets the scheme of the URI (e.g. http)
at line 132
string
getAuthority()
Returns the authority of the URI (e.g. www.example.com:8080)
at line 140
setAuthority(string $authority)
Sets the authority of the URI (e.g. www.example.com:8080)
at line 148
string
getPath()
Returns the path of the URI (e.g. /foo/bar)
at line 156
setPath(string $path)
Set the path of the URI (e.g. /foo/bar)
at line 164
string
getQuery()
Returns the query string part of the URI (e.g. foo=bar)
at line 172
setQuery(string $query)
Set the query string of the URI (e.g. foo=bar)
at line 180
string
getFragment()
Returns the fragment part of the URI (i.e. after the #)
at line 188
setFragment(string $fragment)
Set the fragment of the URI (i.e. after the #)
at line 202
ParsedUri
normalise()
Normalises the path of this URI if it has one.
Normalising a path means that any unnecessary '.' and '..' segments are removed. For example, the URI http://example.com/a/b/../c/./d would be normalised to http://example.com/a/c/d
at line 254
resolve($relUri)
Resolves a relative URI using this URI as the base URI.
at line 313
string
toString()
Convert the parsed URI back into a string
at line 336
string
__toString()
Magic method to convert the URI, when casted, back to a string