Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cjade/id-card
https://github.com/cjade/id-card
Last synced: about 21 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/cjade/id-card
- Owner: cjade
- Created: 2018-06-04T03:47:49.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-06-05T02:18:03.000Z (over 6 years ago)
- Last Synced: 2025-01-10T18:37:35.443Z (14 days ago)
- Language: PHP
- Size: 47.9 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## idcard
二代身份证号码验证,可用于验证二代身份证号码是否合法、从身份证号码中获取生日/性别/年龄/地区信息### 安装
```php
composer require cjade/id-card
```
### 环境要求
- PHP >= 5.6.0
### 使用方法
```php
use IdCard\IdCard;$idCard = IdCard::create();
$idCard->setId('******************');
或者
$idCard = IdCard::create('******************');// 获取生日,格式YYYY mm dd
$identity->getBirthday('-');
// 2018-06-01
$identity->getBirthday('/');
// 2018/06/01//验证身份证号码格式是否正确
idCard = IdCard::create('******************');
$result = $idCard->check()
//true或false
或者
$idCard = IdCard::create('******************')->check();
//true或false//获取身份证号
$id = $idCard->getId();//
```