$ip=get_client_ip(0,true); //获取客户端IP地址(TP方法)
$IpIpLocation = new \Org\Net\IpLocation('data.dat'); // 实例化类 参数表示IP地址库文件
$area = $IpLocation->getlocation($ip); // 获取某个IP地址所在的位置
$str=$area['country'].$area['area']; //合并位置
$str=iconv("GB2312", "UTF-8",$str); //因为最新版为GBK 转为UTF8
dump($str); //输出地址
qqwry.zip
( 4.62 MB 下载:465 次 )
