PHP code example of cjade / id-card

1. Go to this page and download the library: Download cjade/id-card library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

cjade / id-card example snippets


composer 

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();

//