获取代理IP
$_SERVER['REMOTE_ADDR'];
获取真实IP
function get_client_ip()
{
$ip = null;
if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$ip = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);
$ip = trim(current($ip));
}
return $ip;
}
参考
1. https://www.cnblogs.com/lushaoyan/p/11088213.html
标签:HTTP,FORWARDED,ip,SERVER,获取,IP地址,PHP,客户端 From: https://www.cnblogs.com/syutfu/p/16779238.html