PHP code example of chendujin / id-card-number

1. Go to this page and download the library: Download chendujin/id-card-number 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/ */

    

chendujin / id-card-number example snippets




public function store(Request $request)
{
    $validator = Validator::make($request->all(), [
        'id_number' => 'ssage' => $validator->errors()->first(),
        ]);
    }   

}

$IDCard = new \Chendujin\IdCardNumber\IdCardNumber('身份证号码');

// 根据身份证号,自动返回对应的身份证地址(省)
$IDCard->getProvince();

// 根据身份证号,自动返回对应的身份证地址(省市)
$IDCard->getAddress();

// 根据身份证号,自动返回对应的身份证地址(省市区)
$IDCard->getAreaAddress();

// 根据身份证号,自动返回对应的性别
$IDCard->getSex();

// 根据身份证号,自动返回对应的生日
$IDCard->getBirthday();

// 根据身份证号,自动返回对应的星座
$IDCard->getIDCardXZ();

// 根据身份证号,自动返回对应的生肖
$IDCard->getIDCardSX();

// 根据身份证号,自动返回对应的省、自治区、直辖市代
$IDCard->getProvince();
shell script
$app->register(Chendujin\IdCardNumber\ServiceProvider::class);