Home> php教程> php手册> body text

最新版IP定位 纯真数据库(2015.04.25)更新库

WBOY
Release: 2016-06-07 11:38:47
Original
1118 people have browsed it

纯真数据库
$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 下载:283 次 )

AD:真正免费,域名+虚机+企业邮箱=0元

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!