抓取最準的IP,從近到遠做判斷
Last updated
Was this helpful?
Last updated
Was this helpful?
Was this helpful?
if (!empty($_SERVER["HTTP_CLIENT_IP"])){
$ipaddress = $_SERVER["HTTP_CLIENT_IP"];
} else if(!empty($_SERVER["HTTP_X_FORWARDED_FOR"])){
$ipaddress = $_SERVER["HTTP_X_FORWARDED_FOR"