根据IP查询所在地区

IpIp

官网:https://www.ipip.net/
IPv4免费地址库:https://www.ipip.net/product/client.html
Github:https://github.com/ipipdotnet
Java Demo:https://github.com/ipipdotnet/ipdb-java
PHP Demo:https://github.com/ipipdotnet/ipdb-php

public function setIp($ip)
{
    if (!class_exists('IP')) {
        include dirname(__FILE__) . "/../third_party/ipip/IP.class.php";
    }
    $loc = IP::find($ip);
    if ($loc == 'N/A') {
        return;
    }
    if (isset($loc[0]) && $loc[0] != '')
        $this->country = $loc[0];
    if (isset($loc[1]) && $loc[1] != '')
        $this->region = $loc[1];
    if (isset($loc[2]) && $loc[2] != '')
        $this->city = $loc[2];
}

GeoIp

官网:https://dev.maxmind.com/zh-hans/geoip/
GeoLite:https://dev.maxmind.com/zh-hans/geoip/legacy/geolite/
GeoLite2:https://dev.maxmind.com/zh-hans/geoip/geoip2/geolite2/
Github:https://github.com/maxmind
Java Demo:https://github.com/maxmind/GeoIP2-java
PHP Demo:https://github.com/maxmind/GeoIP2-php

在线

IP.CN:https://ip.cn/index.php?ip=8.8.8.8

上一篇 Mac安装Windows图文教程
下一篇 webp转换框架:libwebp
目录
文章列表
1 在Android Studio中自定义Gradle插件
在Android Studio中自定义Gradle插件
2
Java动态修改Enum实例
Java动态修改Enum实例
3
高中数学基础:函数的导数与必须掌握的导数公式
高中数学基础:函数的导数与必须掌握的导数公式
4
微信JS-SDK使用步骤
微信JS-SDK使用步骤
5
Spring Boot事务使用
Spring Boot事务使用
最新评论
一位WordPress评论者
一位WordPress评论者
2月12日
您好,这是一条评论。若需要审核、编辑或删除评论,请访问仪表盘的评论界面。评论者头像来自 Gravatar。