PHPackages                             itxq/ip-php - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. itxq/ip-php

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

itxq/ip-php
===========

纯真IP地址解析类

v1.0.4(6y ago)1781Apache-2.0PHPPHP &gt;=7.1.0

Since Aug 14Pushed 6y agoCompare

[ Source](https://github.com/itxq/ip-php)[ Packagist](https://packagist.org/packages/itxq/ip-php)[ RSS](/packages/itxq-ip-php/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (5)DependenciesVersions (6)Used By (0)

纯真IP地址解析类
=========

[](#纯真ip地址解析类)

[![PHP Version](https://camo.githubusercontent.com/a36ed93e60420b5782989c6c5834d9b2085aab7c1a99bc36751792706a2f0b83/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344372e312d3838393242462e737667)](http://www.php.net/)[![Latest Stable Version](https://camo.githubusercontent.com/1244a7ac9463d742abdfb73496e51cff2bbe43c7761f7feb31cbcf8fe85334e4/68747470733a2f2f706f7365722e707567782e6f72672f697478712f69702d7068702f76657273696f6e)](https://packagist.org/packages/itxq/ip-php)[![Total Downloads](https://camo.githubusercontent.com/d5206f90887e8f41fd98316fbb46d59cb0a0a2d0489b322b17cc15640ef9e084/68747470733a2f2f706f7365722e707567782e6f72672f697478712f69702d7068702f646f776e6c6f616473)](https://packagist.org/packages/itxq/ip-php)[![Latest Unstable Version](https://camo.githubusercontent.com/467b23ffddcc3da1901b33ec27468707a585ccf0ca6ab114c758f492a185c5c6/68747470733a2f2f706f7365722e707567782e6f72672f697478712f69702d7068702f762f756e737461626c65)](//packagist.org/packages/itxq/ip-php)[![License](https://camo.githubusercontent.com/60a25aadb8c664430587a39c65f28b182d3a182c941113b74944029781604104/68747470733a2f2f706f7365722e707567782e6f72672f697478712f69702d7068702f6c6963656e7365)](https://packagist.org/packages/itxq/ip-php)[![composer.lock available](https://camo.githubusercontent.com/33d2141ff9ff6ad5e5e7791e19a1f9fef0649915f5f83a550e5567f50088362d/68747470733a2f2f706f7365722e707567782e6f72672f697478712f69702d7068702f636f6d706f7365726c6f636b)](https://packagist.org/packages/itxq/ip-php)

### 开源地址：

[](#开源地址)

[【GitHub:】https://github.com/itxq/ip-php](https://github.com/itxq/ip-php)

### 扩展安装：

[](#扩展安装)

- 方法一：composer命令 `composer require itxq/ip-php`
- 方法二：直接下载压缩包，然后进入项目中执行 composer命令 `composer update` 来生成自动加载文件

### 引用扩展：

[](#引用扩展)

- 当你的项目不支持composer自动加载时，可以使用以下方式来引用该扩展包

```
// 引入扩展（具体路径请根据你的目录结构自行修改）
require_once __DIR__ . '/vendor/autoload.php';

```

### 使用示例：

[](#使用示例)

```
use itxq\util\IP;

// 实例化时可指定IP数据库文件路径
$IP = new IP();

// 获取全部信息（返回数组）eg：
// array(4) {
//     ["begin_ip"]=>
//   string(8) "1.80.0.0"
//     ["end_ip"]=>
//   string(12) "1.80.155.255"
//     ["address"]=>
//   string(18) "陕西省西安市"
//     ["area"]=>
//   string(6) "电信"
// }
$ipInfoAll = $IP->getIpInfo('1.80.96.23', IP::IP_INFO_ALL);

// 只获取地址信息（返回字符串）eg：贵州省贵阳市南明区电信
$ipInfo = $IP->getIpInfo('1.80.96.23', IP::IP_INFO);

// 获取IP所在IP段（返回数组）eg：['1.80.0.0','1.80.155.255']
$ipRange = $IP->getIpInfo('1.80.96.23', IP::IP_RANGE);
```

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

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

Every ~70 days

Total

5

Last Release

2226d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/928b5ea53fa9cd97dfbdd2a8a5de5020a94722939884a749bda9421a19894c02?d=identicon)[IT小强xqitw.cn](/maintainers/IT%E5%B0%8F%E5%BC%BAxqitw.cn)

---

Top Contributors

[![itxq](https://avatars.githubusercontent.com/u/17096065?v=4)](https://github.com/itxq "itxq (16 commits)")

---

Tags

composeripip-phpipv4php

### Embed Badge

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

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

###  Alternatives

[infocyph/uid

UUID (RFC 9562), ULID, Snowflake ID, Sonyflake ID, and TBSL generator for PHP.

115.7k](/packages/infocyph-uid)

PHPackages © 2026

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