PHP code example of dakalab / card-parser
1. Go to this page and download the library: Download dakalab/card-parser 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/ */
dakalab / card-parser example snippets
use Dakalab\CardParser\IDCard;
$no = 'the-id-number';
$lang = 'zh'; // optional, default is zh
$idCard = new IDCard($no);
$info = $idCard->info; // equal to `$info = $idCard->info();`
print_r($info);
$age = $idCard->age; // equal to `$age = $idCard->age();`
echo $age . PHP_EOL;
echo IDCard::generate();