Dev/uncategorized

[PHP] Get client IP address

공대나왔음 2018. 3. 7. 15:56
$ip = $_SERVER['REMOTE_ADDR'] ? : ($_SERVER['HTTP_X_FORWARDED_FOR'] ? : $_SERVER['HTTP_CLIENT_IP']);


References

  1. http://itman.in/en/how-to-get-client-ip-address-in-php/
  2. https://stackoverflow.com/questions/3003145/how-to-get-the-client-ip-address-in-php
  3. https://www.virendrachandak.com/techtalk/getting-real-client-ip-address-in-php-2/