PHPackages                             feyman/ip-info - 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. feyman/ip-info

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

feyman/ip-info
==============

By IP To Get The Corresponding Country, Province, City, County and ISP

v0.1.0(9y ago)1681[2 issues](https://github.com/feymanlee/ip-info/issues)MITPHPPHP &gt;=5.6

Since Apr 21Pushed 9y ago1 watchersCompare

[ Source](https://github.com/feymanlee/ip-info)[ Packagist](https://packagist.org/packages/feyman/ip-info)[ RSS](/packages/feyman-ip-info/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependencies (3)Versions (7)Used By (0)

ip-info
=======

[](#ip-info)

通过 IP 得到对应的国家 、省（自治区或直辖市）、市(州)、县（区）、运营商。基于 [淘宝 IP 库](http://ip.taobao.com/instructions.php) 和 ipip.net IP 数据库。

[![Build Status](https://camo.githubusercontent.com/7b5649ad9067caafcd83d826d03bac6cce68245615bddf4f3199c3d4d7c58580/68747470733a2f2f7472617669732d63692e6f72672f6665796d616e6c65652f69702d696e666f2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/feymanlee/ip-info)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/e60786e012dcade5ca0d1828487fa68303459cfcf7e2327e1685a657f875bc57/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6665796d616e6c65652f69702d696e666f2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/feymanlee/ip-info/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/23d73da6e4a628e8f02acd13cb98c50d9f701c05252690f41ef4861605a16317/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6665796d616e6c65652f69702d696e666f2f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/feymanlee/ip-info/?branch=master)[![Build Status](https://camo.githubusercontent.com/e9d41b24f937c72773879c8456378fc08d647f8617dbd0f9702340b43947b451/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6665796d616e6c65652f69702d696e666f2f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/feymanlee/ip-info/build-status/master)[![Latest Stable Version](https://camo.githubusercontent.com/c23dd3aa865ba4a7388ecee9737b6722cccd8ce98e20a081a8fb4361b98032b5/68747470733a2f2f706f7365722e707567782e6f72672f6665796d616e2f69702d696e666f2f762f737461626c65)](https://packagist.org/packages/feyman/ip-info)[![Total Downloads](https://camo.githubusercontent.com/aa2badbb39b762cace3cf6c2a3d81fc26ce75a2449cf8bc3b150ed11bb277dd1/68747470733a2f2f706f7365722e707567782e6f72672f6665796d616e2f69702d696e666f2f646f776e6c6f616473)](https://packagist.org/packages/feyman/ip-info)[![License](https://camo.githubusercontent.com/f1ea8854c30a608ac35813834c631df3f9ffca7c6f8d13b4c0d34ae3036d4b3d/68747470733a2f2f706f7365722e707567782e6f72672f6665796d616e2f69702d696e666f2f6c6963656e7365)](https://packagist.org/packages/feyman/ip-info)

Install
-------

[](#install)

```
composer require feyman/ip-info
```

Usage
-----

[](#usage)

```
// 实例化
$info  = new IpInfo($ip);

// 获取详细信息
$info->info();

// 获取地址
// $delimiter 地址各段之间的分隔符
// $full 是否获取完整的地址，默认获取的地址显示为 中国 北京 北京 朝阳 国贸，
// $full = true 时，或加上 area 显示为 中国 华北 北京 北京 朝阳 国贸
$info->address($delimiter = ' ', $full = false);

// 获取 ISP 信息
$info->isp();

// 获取 国家 信息
$info->country();

// 获取 地区 信息，华东，华南，华北
$info->area();

// 获取 省/行政区 信息
$info->region();

// 获取 州/市 信息
$info->city();

// 获取 区/县 信息
$info->county();
```

License
-------

[](#license)

MIT

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity52

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 ~1 days

Total

6

Last Release

3354d ago

PHP version history (2 changes)v0.0.6PHP &gt;=5.1

v0.0.7PHP &gt;=5.6

### Community

Maintainers

![](https://www.gravatar.com/avatar/e5f5329e70cebc7601f3f0a8023429209b1638e80c065e837028294c38f1aad6?d=identicon)[Feyman](/maintainers/Feyman)

---

Top Contributors

[![feymanlee](https://avatars.githubusercontent.com/u/14125552?v=4)](https://github.com/feymanlee "feymanlee (5 commits)")

---

Tags

ipip-addressip-infoip-locationip-locationip-addressIP Info

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[illuminate/pipeline

The Illuminate Pipeline package.

9348.3M268](/packages/illuminate-pipeline)[illuminate/pagination

The Illuminate Pagination package.

10533.5M997](/packages/illuminate-pagination)[illuminate/process

The Illuminate Process package.

44869.2k98](/packages/illuminate-process)[illuminate/cookie

The Illuminate Cookie package.

224.5M132](/packages/illuminate-cookie)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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