PHPackages                             ddllin/lemon - 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. ddllin/lemon

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

ddllin/lemon
============

一个支持获取身份证归属地的PHP库

v2.1(8y ago)61.5k2MITPHPPHP &gt;=5.6.0

Since Oct 28Pushed 8y ago1 watchersCompare

[ Source](https://github.com/linjinmin/Lemon)[ Packagist](https://packagist.org/packages/ddllin/lemon)[ RSS](/packages/ddllin-lemon/feed)WikiDiscussions master Synced today

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

Lemon
=====

[](#lemon)

根据身份证的前4位数字获取该身份证的省会及城市。

[![Build Status](https://camo.githubusercontent.com/d562bd322112802b1bbdb98ad29f720ac355d1f260b6952c80ff3db25ad94c7c/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f64646c6c696e2f6c656d6f6e2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/ddllin/lemon)[![Coverage Status](https://camo.githubusercontent.com/efc7253ce45104a8620d933a157c0553ea38895169b59855b662fd623311901e/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f64646c6c696e2f6c656d6f6e2e7376673f7374796c653d666c61742d737175617265)](https://codecov.io/github/ddllin/lemon)[![Latest Stable Version](https://camo.githubusercontent.com/c8539a15d29efdf9fd0fd6fa191aae3fcf6a3f1173dd18929d1ae7f0ee00951b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f64646c6c696e2f6c656d6f6e2e7376673f7374796c653d666c61742d737175617265266c6162656c3d737461626c65)](https://packagist.org/packages/ddllin/lemon)[![Scrutinizer](https://camo.githubusercontent.com/430673d10e1025d65ad32a807a7c050258da40f759402d89ce0c88640864fe60/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f64646c6c696e2f6c656d6f6e2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/ddllin/lemon/?branch=master)

Installation
------------

[](#installation)

执行下面命令安装

```
> composer require ddllin/lemon
```

Basic Usage
-----------

[](#basic-usage)

身份证前四位代表省会城市，所以必须传递，当然传递身份证全部编码也是可以的;

```
require_once __DIR__ . '/vendor/autoload.php';

use Lemon\Query\Query;

var_dump(Query::query('xxxxx'));
```

返回格式为json字符串

```
{
    "province": "云南省",
    "city": "玉溪市"
}
```

License
-------

[](#license)

The MIT license. See [MIT](https://opensource.org/licenses/MIT)

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 80% 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 ~2 days

Total

6

Last Release

3159d ago

Major Versions

v1.5 → v2.02017-10-28

### Community

Maintainers

![](https://www.gravatar.com/avatar/1c976066db8226c7901d34cc7e1fde37c4d20867a1990eb2ad6fd515cb34c6f2?d=identicon)[ddllin](/maintainers/ddllin)

---

Top Contributors

[![linjinmin](https://avatars.githubusercontent.com/u/18466014?v=4)](https://github.com/linjinmin "linjinmin (4 commits)")[![slince](https://avatars.githubusercontent.com/u/3785826?v=4)](https://github.com/slince "slince (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ddllin-lemon/health.svg)

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

PHPackages © 2026

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