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

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

wisonlau/identity-card
======================

A simple proof of identity card of the people's Republic of China.

00PHP

Since Jul 5Pushed 7y agoCompare

[ Source](https://github.com/wisonlau/identity-card)[ Packagist](https://packagist.org/packages/wisonlau/identity-card)[ RSS](/packages/wisonlau-identity-card/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

China (region) citizen ID card tool
-----------------------------------

[](#china-region-citizen-id-card-tool)

> China (Mainland) ID card package, the data from the national standard `GB/T 2260-2007` [ (People's Republic of China administrative divisions code standard).](http://www.stats.gov.cn)

Installing
----------

[](#installing)

```
    composer require wisonlau/identity-card
```

Instructions
------------

[](#instructions)

A component based on People's Republic of China citizen ID card to obtain the user information.This works for any php framework, but only if the php version is greater than 7.1.

Useing
------

[](#useing)

#### Verify your Chinese ID card

[](#verify-your-chinese-id-card)

```
    // Result false OR Ofcold\IdentityCard\IdentityCard instance.
    $result = Ofcold\IdentityCard\IdentityCard::make('32010619831029081');

    if ( $result === false ) {

        return 'Your ID number is incorrect';
    }

    print_r($result->toArray());
```

#### OR test file.

[](#or-test-file)

```
    php test
```

```
$idCard = Ofcold\IdentityCard\IdentityCard::make('320106198310290811', 'en');
//  Use locale, Current supported zh-cn,en
// $idCard = Ofcold\IdentityCard\IdentityCard::make('320106198310290811', 'zh-cn');
if ( $idCard === false ) {

    return 'Your ID number is incorrect';
}
$area = $idCard->getArea();
$gender = $idCard->getGender();
$birthday = $idCard->getBirthday();
$age = $idCard->getAge();
$constellation = $idCard->getConstellation();
```

#### Results:

[](#results)

```
{
    "area": "shan xi sheng yun cheng di qu yun cheng shi",
    "province": "shan xi sheng",
    "city": "yun cheng di qu",
    "county": "yun cheng shi",
    "gender": "Male",
    "birthday": "1980-03-12",
    "zodiac": "Pig",
    "age": 38,
    "constellation": "Pisces"
}
```

### Api

[](#api)

- getArea() : string `Get Area`
- getConstellation() : string `Get constellation`
- getZodiac() : string `Get zodiac`
- getAge() : int `Get age`
- getBirthday(string $foramt = 'Y-m-d') : string `Get birthday`
- getGender() : string `Get gender`
- getCounty() : string|null `Get county`
- getCity() : string|null `Get city`
- getProvince() : string|null `Get province`
- toArray() : array `Get all information.`
- toJson(int $option) : string `Json format all information`
- \_\_get() : mixed
- \_\_toString() : toJson

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity40

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/8781ca13a2d63ed7eb3eb9738331e8b375ade5f834ea204988e1936030dd1c0e?d=identicon)[wisonlau](/maintainers/wisonlau)

---

Top Contributors

[![p99993](https://avatars.githubusercontent.com/u/22674454?v=4)](https://github.com/p99993 "p99993 (1 commits)")

### Embed Badge

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

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

###  Alternatives

[monsoonconsulting/magento2-pwa

Adds a service worker to Magento2 to enable PWA features.

2322.9k](/packages/monsoonconsulting-magento2-pwa)[yii2mod/yii2-selectize

selectize.js wrapper for yii2

1730.7k1](/packages/yii2mod-yii2-selectize)

PHPackages © 2026

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