cszchen/citizenid

中国居民身份证号码信息验证

Installs: 12 232

Dependents: 2

Suggesters: 0

Security: 0

Stars: 49

Watchers: 3

Forks: 20

Open Issues: 0

Type:extension

v2.0.1 2018-04-30 07:09 UTC

This package is not auto-updated.

Last update: 2020-11-20 17:30:55 UTC


README

检验一个身份证号码的格式是否正确,并且可以获取到生日,性别,办证区域

安装

composer require cszchen/citizenid

使用

use cszchen\citizenid\Parser;
    
$parser = new Parser();
$parser->setId($id);
    
//身份证号码格式是否正确
$parser->isValidate();
    
//获取生日,格式YYYYmmdd
$parser->getBirthday();
    
//获取性别, 1-男, 0-女,对应的常量为Parser::GENDER_MALE, Parser::GENDER_FEMALE
$parser->getGender()