PHPackages                             chibitools/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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. chibitools/ip

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

chibitools/ip
=============

IPIP.net officially supported IP database ipdb format parsing library

v1.0.0(6y ago)014.4k↓33.3%Apache-2.0PHPPHP &gt;=5.4.0

Since May 31Pushed 6y agoCompare

[ Source](https://github.com/Tiny-Box/IPDB)[ Packagist](https://packagist.org/packages/chibitools/ip)[ Docs](https://www.ipip.net)[ RSS](/packages/chibitools-ip/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

Baixing IP to City Library
==========================

[](#baixing-ip-to-city-library)

(Maintained by [箱子](mailto:wangyanxiang@baixing.com))

镐京内使用的通过 IP 查询 城市 的 PHP 基础库

### 使用方法

[](#使用方法)

```
/**
 * return city name of the given ip or null if not found
 * @param string $ip IP address in string format
 * @return Array|null $ipCityInfo
 */
$city = Baixing\Util\IP::getIpCityInfoCN($ip);

$city = [
    0 => '中国',
    1 => '陕西',
    2 => '西安'
];
```

### 目录结构

[](#目录结构)

```
.
├──composer.json
├──src\
└──unittest\

```

#### `src` 目录

[](#src-目录)

IP 查询源码

#### `unittest` 目录

[](#unittest-目录)

Unit test，可以用以下命令运行

```
# at project root folder
composer install
vendor/bin/phpunit --bootstrap vendor/autoload.php unittest/
```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity54

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

2544d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d553bf1de9caf48dc5b5c19dfcf367db0d060b72073e7d02449ea03a7b39efe4?d=identicon)[Tiny-Box](/maintainers/Tiny-Box)

---

Top Contributors

[![Tiny-Box](https://avatars.githubusercontent.com/u/7588395?v=4)](https://github.com/Tiny-Box "Tiny-Box (3 commits)")

---

Tags

geoipgeolocationIPgeoipip.netipdb

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[ipip/db

IPIP.net officially supported IP database ipdb format parsing library

139204.2k6](/packages/ipip-db)[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)[ipip/datx

IPIP.net官方支持的IP数据库datx格式解析库

3731.0k](/packages/ipip-datx)[geo-io/wkb-parser

Well-known binary (WKB) Parser.

786.0M48](/packages/geo-io-wkb-parser)[creof/geo-parser

Parser for geography coordinate strings

624.4M15](/packages/creof-geo-parser)

PHPackages © 2026

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