PHP code example of alexeevdv / indonesia-personal-id
1. Go to this page and download the library: Download alexeevdv/indonesia-personal-id 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/ */
alexeevdv / indonesia-personal-id example snippets
use alexeevdv\personalid\indonesia\Validator;
$validator = new Validator;
$isValid = $validator->validate('NIK_TO_BE_VALIDATED');
use alexeevdv\personalid\indonesia\Parser;
$parser = new Parser;
// Returns identity instance
$identity = $parser->parse('NIK_TO_BE_PARSED');
echo $identity->birthDate()->format('Y-m-d');
use alexeevdv\personalid\indonesia\Builder;
$builder = new Builder;
$randomNik = $builder->random();
// Generates NIK from identity instance
$nikFromIdentity = $builder->fromIdentity($identity);
$ php composer.phar