Skip to content

Commit

Permalink
update docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bill li committed Nov 19, 2017
1 parent 71b7bde commit 7e362b2
Showing 1 changed file with 15 additions and 21 deletions.
36 changes: 15 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,35 +14,29 @@ China (region) citizen ID card tool

### Instructions

zh-cn

```php

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

$area = $idCard->getArea();
$gender = $idCard->getGender();
$birthday = $idCard->getBirthday();
$age = $idCard->getAge();
$constellation = $idCard->getConstellation();
// Use locale, Current supported zh-cn,en
// $idCard = Anomaly\Component\IdentityCard\IdentityCard::make('320106198310290811', 'zh-cn');

try {
$area = $idCard->getArea();
$gender = $idCard->getGender();
$birthday = $idCard->getBirthday();
$age = $idCard->getAge();
$constellation = $idCard->getConstellation();
}
catch (\Exception $e)
{
$e->getMessage();
}



```

en

```php

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

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


```

#### Results:
```json
Expand Down

0 comments on commit 7e362b2

Please sign in to comment.