定制 zhengbingdong/ip-addrs 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

zhengbingdong/ip-addrs

最新稳定版本:1.0.1

Composer 安装命令:

composer require zhengbingdong/ip-addrs

包简介

无需注册, 完全免费IP归属地查询API,快速查询IP地址的地理位置、运营商等信息,不限量,随便用

README 文档

README

无需注册, 完全免费IP归属地查询API,快速查询IP地址的地理位置、运营商等信息,不限量,随便用

官网

免费IP解析

https://ip.zhengbingdong.com

更多分享信息内容请关注我的公众号:程序猿的栖息地

程序猿的栖息地

安装

$ composer require zhengbingdong/ip-addrs

用法

<?php

use Zhengbingdong\IpAddr\IpAddrClient;

/**
 * IP解析工具类
 * Class DateTools
 */

class Client{

    /**
     * [get 解析IP]
     * @since  2025-10-23
     * @author Dai哥
     * @param  [type]     $ip [IP地址]
     * @return [type]         [description]
     */
    public function index()
    {
        $ip = '127.0.0.1';

        $info = IpAddrClient:get($ip);
    }
}

返回值

{
  "ret": 200,               // 200为正常
  "data": {
    "ip": "58.30.0.0",     // 查询的IP地址
    "country": "中国",      // 国家/地区
    "country_code": "cn",   // 国家/地区简码
    "prov": "北京",         // 省份
    "city": "北京",         // 城市
    "city_code": "beijing", // 城市简码
    "city_short_code": "bj", // 城市简码
    "area": "东城",         // 区县
    "post_code": "100000", //邮政编码
    "area_code": "010",    // 电话区号
    "isp": "中国移动",      // 运营商
    "lng": "116.41005",    // 城市中心-经度
    "lat": "39.93157",     // 城市中心-纬度
    "long_ip": 975044608,  // longip
    "big_area": "华北",     // 国内大区划分
  },
  "qt": 0.001              // 查询时间-秒
}

统计信息

  • 总下载量: 16
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-10-24