uuling/id-card
最新稳定版本:1.0
Composer 安装命令:
composer require uuling/id-card
包简介
身份证号码验证,兼容18位和15位的新老身份证
关键字:
README 文档
README
- 身份证号码验证,兼容18位和15位的新老身份证
- 基于 国标
GB/T 2260-2007(中华人民共和国行政区划代码 标准) 。
安装
composer require uuling/id-card
环境要求
- PHP >= 5.4.0
使用说明
use Uuling\Idcard; $identity = new Identity(); $identity->setId('******************'); 或者 $identity = new Identity('******************'); // 验证身份证号码格式是否正确 $identity->isValidate(); // true 或者 false // 获取生日,格式YYYY mm dd $identity->getBirth('-'); // 2015-01-01 $identity->getBirth('/'); // 2015/01/01 // 获取性别 $identity->getGender(); // m $identity->getGender(Identity::GENDER_CN); // 男 // 获取区域 $identity->getArea(); // ['province' => '***', 'city' => '***', 'county' => '***']
选项
| 选项 | 描述 |
|---|---|
| Identity::GENDER_EN | 性别显示方式:英文首字符【默认】(m/f) |
| Identity::GENDER_CN | 性别显示方式:中文(男/女) |
License
MIT
统计信息
- 总下载量: 9.02k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 18
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-11-26