PHP取得用户真实IP


function getIp() {

if($_SERVER['HTTP_CLIENT_IP']) {

$ip = $_SERVER['HTTP_CLIENT_IP'];

} elseif ($_SERVER['HTTP_X_FORWARDED_FOR']) {

$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];

} else {

$ip = $_SERVER['REMOTE_ADDR'];

}

}
中国数据 q:800013911转1018

你可能感兴趣的:(PHP取得用户真实IP)