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

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

wdteam/yii2-generate-ip
=======================

YII2 yii2-generate-ip

16PHP

Since Jul 24Pushed 8y ago1 watchersCompare

[ Source](https://github.com/WDTeam/yii2-generate-ip)[ Packagist](https://packagist.org/packages/wdteam/yii2-generate-ip)[ RSS](/packages/wdteam-yii2-generate-ip/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

generateIP
==========

[](#generateip)

根据省份名称随机生成对应省份IPV4地址

目录文件
----

[](#目录文件)

```
QueryList.class.php             // PHP采集类
```

```
phpQuery                        // QueryList类所需文件目录
```

```
IP.class.php                    // 主IP生成类
```

```
ip_segment.php                  // 采集生成的IPV4地址段
```

使用说明
----

[](#使用说明)

### 引入IP类

[](#引入ip类)

```
require 'IP.class.php';
```

### 方法使用

[](#方法使用)

##### 不指定省份名，将随机生成国内IPV4地址

[](#不指定省份名将随机生成国内ipv4地址)

```
$ip_address = IP::generate();
```

##### 指定省份名生成对应省份IPV4地址

[](#指定省份名生成对应省份ipv4地址)

```
$ip_address = IP::generate('安徽');
```

##### 更新各省IPV4地址段

[](#更新各省ipv4地址段)

```
IP::update();
```

文件包含省份：

```
* 北京
* 广东
* 山东
* 浙江
* 江苏
* 上海
* 辽宁
* 四川
* 河南
* 湖北
* 福建
* 湖南
* 河北
* 重庆
* 山西
* 江西
* 陕西
* 安徽
* 黑龙江
* 广西
* 吉林
* 云南
* 天津
* 内蒙
* 新疆
* 甘肃
* 贵州
* 海南
* 宁夏
* 青海
* 西藏
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 85.7% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/4744060461d6f3bfef29c7540df27baae763ccb780d0475bb3c736de86137862?d=identicon)[Winds](/maintainers/Winds)

---

Top Contributors

[![copypasteengine](https://avatars.githubusercontent.com/u/147691212?v=4)](https://github.com/copypasteengine "copypasteengine (6 commits)")[![windsdeng](https://avatars.githubusercontent.com/u/1351690?v=4)](https://github.com/windsdeng "windsdeng (1 commits)")

### Embed Badge

![Health badge](/badges/wdteam-yii2-generate-ip/health.svg)

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

###  Alternatives

[mokhosh/filament-jalali

Add Jalali datetime to your filament tables

6744.4k2](/packages/mokhosh-filament-jalali)[marcusball/case-helper

Easily convert between camelCase, PascalCase, kebab-case, snake\_case, SCREAMING\_SNAKE\_CASE, Train-Case, and string case!

2145.5k3](/packages/marcusball-case-helper)

PHPackages © 2026

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