zhuzhichao / ip-location-zh Goto Github PK
View Code? Open in Web Editor NEW获取 IP 地址的真实地理位置
Home Page: https://packagist.org/packages/zhuzhichao/ip-location-zh
License: MIT License
获取 IP 地址的真实地理位置
Home Page: https://packagist.org/packages/zhuzhichao/ip-location-zh
License: MIT License
没有国别码呢
比如,北京市返回北京市而不是北京。
离线数据库更新日期已经过去半年多了,可否提供方法可随时手动更新数据库?例如,更新脚本。
或者,不方便的话告知dat文件格式和更新逻辑也可以。
谢谢!
请问有没有跟进官方新版数据库的计划?
你这个cityid挺好用的,我基本就靠这个定位了
比如 120.52.147.18
Notice: Undefined index: 本机地址 in vendor\zhuzhichao\ip-location-zh\src\Ip.php on line 225
Warning: Invalid argument supplied for foreach() in vendor\zhuzhichao\ip-location-zh\src\Ip.php on line 225
if(isset($locationCode[$province])){
$code = $locationCode[$province]["code"];
}
foreach($locationCode[$province]["city"] as $key => $loc){
if(strpos($key,$city) !== false){
$code = $loc;
return $code;
}
}
代码这里是不是该这样子写,$locationCode 中没有这个$province的时候会报错
if(isset($locationCode[$province])){
$code = $locationCode[$province]["code"];
foreach($locationCode[$province]["city"] as $key => $loc){
if(strpos($key,$city) !== false){
$code = $loc;
return $code;
}
}
}
为何小版本要改类库名字?从 IP 改成了 Ip,导致找不到类库,不能升到 2.0 么?
可以返回IP的经纬度信息么?
我只想让他来判断是不是**的IP就可以
试了 101.226.178.189
(上海)、180.97.33.108
(南京),都是错的。
有时间我提一个 PR。
毕竟数据都是ipip.net的现成的东西,个人觉得可以做成自动化的更新。。。
\Zhuzhichao\IpLocationZh\Ip::find('110.223.0.43')
返回一个
[ErrorException]
strpos(): Empty needle
项目很棒!
目前返回的信息只有中文,希望能返回国标的country code.
祝好。
Fatal error: Uncaught think\exception\ErrorException: fclose(): supplied resource is not a valid stream resource
zhuzhichao\ip-location-zh\src\Ip.php on line 247
fclose() 的时候应该多加一个判断 is_resource(self::$fp)
if (self::$fp !== null && is_resource(self::$fp)) {
fclose(self::$fp);
}
这样就阔以了
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.