ntlab/ntlib

PHP common library

v1.1.2 2021-07-21 13:50 UTC

This package is auto-updated.

Last update: 2021-08-21 14:03:44 UTC


README

Common Library

Beautifier

Provide text beautifier functionality with integrated Roman number checker.

<?php

use NTLAB\Lib\Common\Beautifier;

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

Roman

Roman converts number to roman and vice versa.

<?php

use NTLAB\Lib\Common\Roman;

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

Terbilang

Number to text for Indonesian.

<?php

use NTLAB\Lib\Common\Terbilang;

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

Gelar

An Indonesian title stripper.

<?php

use NTLAB\Lib\Common\Gelar;

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

Identity Library

NIK

NIK encoder/decoder.

<?php

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

NIP

NIP encoder/decoder.

<?php

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