mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-07-11 23:22:11 +00:00
[TASK] Added ip method to Response class.
This commit is contained in:
@@ -60,6 +60,14 @@ class Request {
|
|||||||
return $this->headers;
|
return $this->headers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get id address
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getIp() {
|
||||||
|
return isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get header value by name
|
* Get header value by name
|
||||||
* @param string $name
|
* @param string $name
|
||||||
|
|||||||
Reference in New Issue
Block a user