PHP code example of ntlab / ntlib

1. Go to this page and download the library: Download ntlab/ntlib 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/ */

    

ntlab / ntlib example snippets




use NTLAB\Lib\Common\Beautifier;

echo Beautifier::beautify('SEKOLAH DASAR NEGERI II'); // Sekolah Dasar Negeri II



use NTLAB\Lib\Common\Roman;

echo Roman::asInteger('XXVI'); // 26
echo Roman::asRoman(51); // LI



use NTLAB\Lib\Common\Terbilang;

echo Terbilang::getInstance()->convert(1001); // SERIBU SATU



use NTLAB\Lib\Common\Gelar;

echo Gelar::strip('Drs. IHSAN SAPUTRA, M.Si'); // IHSAN SAPUTRA



use NTLAB\Lib\Identity\Ids\Nik;

$nik = new Nik('3515155202000005');
echo $nik->getWilayah(); // 351515
echo $nik->getTglLahir()->format('d-m-Y'); // 12-02-2000
echo $nik->getGender(); // P
echo $nik->getUrut(); // 5



use NTLAB\Lib\Identity\Ids\Nip;

$nip = new Nip('199909272020011004');
echo $nip->getTglLahir()->format('d-m-Y'); // 27-09-1999
echo $nip->getTmtCapeg()->format('d-m-Y'); // 01-01-2020
echo $nip->getGender(); // 1
echo $nip->getUrut(); // 4



use NTLAB\Lib\Identity\Ids\Nrp;

$nrp = new Nrp('96090050');
echo $nrp->getLahir()->format('d-m-Y'); // 01-09-1996
echo $nrp->getUrut(); // 50