function getRealIP() {
$ip = '';
if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
} elseif (!empty($_SERVER['HTTP_CLIENT_IP'])) {
$ip = $_SERVER['HTTP_CLIENT_IP'];
} elseif (!empty($_SERVER['REMOTE_ADDR'])) {
$ip = $_SERVER['REMOTE_ADDR'];
}else{
$ip = 'Unknown';
}
return $ip;
}
本文共309个字符,其中有 0 个汉字,平均阅读时长 ≈ 2分钟
评论