PHP code example of amculin / ektp-generator
1. Go to this page and download the library: Download amculin/ektp-generator 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/ */
amculin / ektp-generator example snippets
use amculin\ektp\generator\KTP;
$identity = new KTP();
echo "NIK: {$identity->getNIK()}";
echo "Province: {$identity->getProvince()->id} - {$identity->getProvince()->name}\n";
echo "City: {$identity->getCity()->id} - {$identity->getCity()->name}\n";
echo "District: {$identity->getDistrict()->id} - {$identity->getDistrict()->name}\n";
$birthDate = $identity->getBirthDate()->birthDate;
$date = $identity->getBirthDate()->date;
$month = $identity->getBirthDate()->month;
$year = $identity->getBirthDate()->year;
echo "Birth Date: {$birthDate} / {$date}-{$month}-{$year}\n";