Skip to content

Commit

Permalink
Init identity card of china.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bill li committed Nov 19, 2017
1 parent cb423e8 commit f16c305
Show file tree
Hide file tree
Showing 4 changed files with 24,974 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/vendor/
.DS_Store
.phpintel
42 changes: 40 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,40 @@
# identity-card
A simple proof of identity card of the people's Republic of China.

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).
### Installing

```bash

composer require anomalylab/component-identity-card
```


### Instructions

```php

$idCard = Anomaly\Component\IdentityCard\IdentityCard::make('320106198310290811');

$area = $idCard->getArea();
$gender = $idCard->getGender();
$birthday = $idCard->getBirthday();
$age = $idCard->getAge();
$constellation = $idCard->getConstellation();


```

Results:
```json

{
"area": "江苏省 南京市 鼓楼区",
"gender": "male",
"birthday": "1983-10-29",
"age": 34,
"constellation": "天蝎座"
}
```
27 changes: 27 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "anomalylab/component-identity-card",
"description": "A simple proof of identity card of the people's Republic of China.",
"keywords": [
"php71",
"ID Card",
"Region",
"Area"
],
"type": "library",
"license": "MIT",
"homepage": "https://anomalylab.org",
"authors": [
{
"name": "Bill li",
"email": "[email protected]"
}
],
"require": {
"php": ">=7.1"
},
"autoload": {
"psr-4": {
"Anomaly\\Component\\IdentityCard": "src/"
}
}
}
Loading

0 comments on commit f16c305

Please sign in to comment.