/**
* @Author:小破孩
* @Time: 2020/7/15 13:06
* @return mixed
* @Description:获取客户端ip
*/
function get_client_ip(){
if(!empty($_SERVER['HTTP_CLIENT_IP'])){
//ip from share internet
$ip = $_SERVER['HTTP_CLIENT_IP'];
}elseif(!empty($_SERVER['HTTP_X_FORWARDED_FOR'])){
//ip pass from proxy
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
}else{
$ip = $_SERVER['REMOTE_ADDR'];
}
return $ip;
}
最后修改:2021 年 02 月 03 日 09 : 57 AM
© 允许规范转载