PHPackages                             chrisfoon/identity-card - 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. chrisfoon/identity-card

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

chrisfoon/identity-card
=======================

Chinese Identity Card package

1.1.0(10y ago)0260MIT

Since Apr 28Compare

[ Source](https://github.com/chrisfoon/identity-card)[ Packagist](https://packagist.org/packages/chrisfoon/identity-card)[ RSS](/packages/chrisfoon-identity-card/feed)WikiDiscussions Synced 6d ago

READMEChangelogDependenciesVersions (3)Used By (0)

Identity Card（中国大陆）公民身份证类
-------------------------

[](#identity-card中国大陆公民身份证类)

\###安装说明

在 `composer` 中添加依赖：

```
	"require": {
		"douyasi/identity-card": "dev-master"
	},
```

然后在命令行窗体里执行 `composer update` 命令。

\###使用说明

创建ID类的实例，然后调用其对应方法。

`Laravel 5` 测试路由示例：

```
Route::get('test', function(){
	$ID = new Douyasi\IdentityCard\ID;
	$is_pass = $ID->validateIDCard('42032319930606629x');  //校验身份证证号是否合法
	$area = $ID->getArea('42032319930606629x');  //获取身份证所在地信息 遵循GB/T 2260-2007中华人民共和国行政区划代码 标准
	$gender = $ID->getGender('42032319930606629x');  //获取性别 'f'表示女，'m'表示男，校验失败返回false
	$birthday = $ID->getBirth('42032319930606629x');  //获取出生日期
	return compact('is_pass', 'area', 'gender', 'birthday');
});
```

上面测试路由将返回下面 `json` 数据响应：

```
{
    "is_pass":true,
    "area":{
            "status":true,
            "result":"湖北省 十堰市竹山县",
            "provice":"湖北省",
            "city":"十堰市",
            "county":"竹山县"
        },
    "gender":"m",
    "birthday":"1993-06-06"
}
```

###  Health Score

28

—

LowBetter than 51% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity64

Established project with proven stability

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

Total

2

Last Release

3708d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0997cd31d233e025221d1971deb84d9ce892d648e5ee987447bcb50c32fe148a?d=identicon)[chrisfoon](/maintainers/chrisfoon)

---

Top Contributors

[![ycrao](https://avatars.githubusercontent.com/u/3280204?v=4)](https://github.com/ycrao "ycrao (6 commits)")

---

Tags

identityChinesepersonal identity card

### Embed Badge

![Health badge](/badges/chrisfoon-identity-card/health.svg)

```
[![Health](https://phpackages.com/badges/chrisfoon-identity-card/health.svg)](https://phpackages.com/packages/chrisfoon-identity-card)
```

###  Alternatives

[overtrue/pinyin

Chinese to pinyin translator.

4.5k7.1M80](/packages/overtrue-pinyin)[douyasi/identity-card

Chinese Identity Card package

17653.5k3](/packages/douyasi-identity-card)[zhuzhichao/ip-location-zh

get the ip's location info with Chinese

616218.8k17](/packages/zhuzhichao-ip-location-zh)[overtrue/chinese-calendar

中国农历转换与查询工具

544120.5k6](/packages/overtrue-chinese-calendar)[zhuzhichao/bank-card-info

Get the bank card info

45365.7k](/packages/zhuzhichao-bank-card-info)[wilon/php-number2chinese

PHP数字转为汉字描述、人民币大写方法。

14232.6k1](/packages/wilon-php-number2chinese)

PHPackages © 2026

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