Created
November 24, 2020 08:05
-
-
Save ericstone57/1c012cfad96e29ad3ae9486b71fe166c to your computer and use it in GitHub Desktop.
Get IP Address
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// uses isset to remove notices | |
$ip = isset($_SERVER['HTTP_CLIENT_IP']) ? $_SERVER['HTTP_CLIENT_IP'] : isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment