mirror of
https://github.com/YGGverse/titan-II.git
synced 2025-03-13 05:51:04 +00:00
Add URL parsing.
This commit is contained in:
parent
f8015cadda
commit
bc320fab7a
@ -33,4 +33,34 @@ class Request {
|
||||
{
|
||||
return $this->url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Hostname.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getHost(): string
|
||||
{
|
||||
return parse_url($this->url, PHP_URL_HOST);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Path.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPath(): string
|
||||
{
|
||||
return parse_url($this->url, PHP_URL_PATH);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Query.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getQuery(): string
|
||||
{
|
||||
return parse_url($this->url, PHP_URL_QUERY);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user