2017 © Pedro Peláez
 

library identity-card

Chinese Identity Card package

image

chrisfoon/identity-card

Chinese Identity Card package

  • Monday, June 20, 2016
  • by chrisfoon
  • Repository
  • 1 Watchers
  • 0 Stars
  • 120 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 18 Forks
  • 0 Open issues
  • 3 Versions
  • 20 % Grown

The README.md

Identity Card(中国大陆)公民身份证类

安装说明

composer 中添加依赖:, (*1)

    "require": {
        "douyasi/identity-card": "dev-master"
    },

然后在命令行窗体里执行 composer update 命令。, (*2)

使用说明

创建ID类的实例,然后调用其对应方法。, (*3)

Laravel 5 测试路由示例:, (*4)

Route::get('test', function(){
    $ID = new Douyasi\IdentityCard\ID;
    $is_pass = $ID->validateIDCard('42032319930606629x');  //校验身份证证号是否合法
    $area = $ID->getArea('42032319930606629x');  //获取身份证所在地信息 遵循GB/T 2260-2007中华人民共和国行政区划代码 标准
    $gender = $ID->getGender('42032319930606629x');  //获取性别 'f'表示女,'m'表示男,校验失败返回false
    $birthday = $ID->getBirth('42032319930606629x');  //获取出生日期
    return compact('is_pass', 'area', 'gender', 'birthday');
});

上面测试路由将返回下面 json 数据响应:, (*5)

{
    "is_pass":true,
    "area":{
            "status":true,
            "result":"湖北省 十堰市竹山县",
            "provice":"湖北省",
            "city":"十堰市",
            "county":"竹山县"
        },
    "gender":"m",
    "birthday":"1993-06-06"
}

The Versions

20/06 2016

dev-master

9999999-dev

Chinese Identity Card package

  Sources   Download

MIT

identity chinese personal identity card

20/06 2016

1.1.0

1.1.0.0

Chinese Identity Card package

  Sources   Download

MIT

identity chinese personal identity card

28/04 2016

1.0

1.0.0.0

Chinese Identity Card package

  Sources   Download

MIT

identity chinese personal identity card