标签:nbsp tip getenv get 取ip地址 获取ip forward fun remote
public function getIP() { if (getenv("HTTP_CLIENT_IP")) $ip = getenv("HTTP_CLIENT_IP"); else if(getenv("HTTP_X_FORWARDED_FOR")) $ip = getenv("HTTP_X_FORWARDED_FOR"); else if(getenv("REMOTE_ADDR")) $ip = getenv("REMOTE_ADDR"); else $ip = "UNKNOWN"; return $ip; }
标签:nbsp tip getenv get 取ip地址 获取ip forward fun remote
原文地址:http://www.cnblogs.com/wu-song/p/7987761.html