diff --git a/README.md b/README.md index a2585bb..e74ee39 100644 --- a/README.md +++ b/README.md @@ -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