PHPackages                             bianchengxia/ip - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. bianchengxia/ip

ActiveLibrary

bianchengxia/ip
===============

bianchengxia-php-sdk-ip

1.0.0(7y ago)1231MITPHPPHP &gt;=5.3.5

Since Mar 15Pushed 7y agoCompare

[ Source](https://github.com/BianChengXia/bianchengxia-php-sdk-ip)[ Packagist](https://packagist.org/packages/bianchengxia/ip)[ Docs](https://www.bianchengxia.com/)[ RSS](/packages/bianchengxia-ip/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

编程侠IP地址库PHP版
============

[](#编程侠ip地址库php版)

1. 99.9%准确率，定时更新：
=================

[](#1-999准确率定时更新)

数据聚合了一些知名ip到地名查询提供商的数据，这些是他们官方的的准确率，经测试着实比纯真啥的准确多了。 每次聚合一下数据需要1-2天，会不定时更新。

2. 标准化的数据格式：
============

[](#2-标准化的数据格式)

每条ip数据段都固定了格式：城市ID|国家|区域|省份|城市|ISP

只有中国的数据精确到了城市，其他国家只能定位到国家，后前的选项全部是0，已经包含了全部你能查到的大大小小的国家。 （请忽略前面的城市Id，个人项目需求）

3. Composer 安装
==============

[](#3-composer-安装)

```
composer require bianchengxia/ip
```

4. 使用方法
=======

[](#4-使用方法)

```
require_once '../src/Ip2Region.class.php';//使用composer无需手动引入
//$ip2region = new \Ip2Region();//适用于命名空间
$ip2region = new Ip2Region();//适用于没有使用命名空间
$ip = '113.205.63.37';
$info = $ip2region->btreeSearch($ip);
if (!empty($info)) {
    $info = explode('|', $info);
}
-------------------------------------
Array
(
    [0] => 中国
    [1] => 0
    [2] => 重庆
    [3] => 重庆市
    [4] => 联通
)
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2617d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7abf7ce3ae676fa11d3a456b21a599d36cd6553334b785f7ff2229b5b5f0d973?d=identicon)[bianchengxia](/maintainers/bianchengxia)

---

Top Contributors

[![BianChengXia](https://avatars.githubusercontent.com/u/31750190?v=4)](https://github.com/BianChengXia "BianChengXia (2 commits)")

---

Tags

IPbianchengxia

### Embed Badge

![Health badge](/badges/bianchengxia-ip/health.svg)

```
[![Health](https://phpackages.com/badges/bianchengxia-ip/health.svg)](https://phpackages.com/packages/bianchengxia-ip)
```

###  Alternatives

[geoip2/geoip2

MaxMind GeoIP2 PHP API

2.5k85.4M294](/packages/geoip2-geoip2)[stevebauman/location

Retrieve a user's location by their IP Address

1.3k7.6M65](/packages/stevebauman-location)[zoujingli/ip2region

ip2region v3.0 for PHP - 企业级 IP 地理位置查询库，支持 IPv4 和 IPv6，多种缓存策略，零依赖，开箱即用

1.4k437.1k56](/packages/zoujingli-ip2region)[mlocati/ip-lib

Handle IPv4, IPv6 addresses and ranges

3126.4M44](/packages/mlocati-ip-lib)[s1lentium/iptools

PHP Library for manipulating network addresses (IPv4 and IPv6)

2446.2M24](/packages/s1lentium-iptools)[vectorface/whip

A PHP class for retrieving accurate IP address information for the client.

3781.1M14](/packages/vectorface-whip)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
