标签:long sprintf ddr _for null false print php get
function getip(){ static $ip = null; if($ip !=null) return $ip; if(getenv(‘REMOTE_ADDR‘)) $ip = sprintf(‘%u‘,ip2long(getenv(‘REMOTE_ADDR‘))); elseif(getenv(‘HTTP_CLIENT_IP‘)) $ip = sprintf(‘%u‘,ip2long(getenv(‘HTTP_CLIENT_IP‘))); elseif(getenv(‘HTTP_X _FORWARAED_FOR‘)) $ip = sprintf(‘%u‘,ip2long(getenv(‘HTTP_X _FORWARAED_FOR‘))); return $ip; }
标签:long sprintf ddr _for null false print php get
原文地址:http://www.cnblogs.com/lauhp/p/7999592.html