ntlab / ntlib
PHP 常用库
v1.2.0
2024-09-12 08:25 UTC
Requires
- php: >=7.1
Requires (Dev)
- phpunit/phpunit: ^9.5
README
常用库
美化器
提供带集成罗马数字校验器的文本美化功能。
<?php use NTLAB\Lib\Common\Beautifier; echo Beautifier::beautify('SEKOLAH DASAR NEGERI II'); // Sekolah Dasar Negeri II
罗马数字
罗马数字转换,反之亦然。
<?php use NTLAB\Lib\Common\Roman; echo Roman::asInteger('XXVI'); // 26 echo Roman::asRoman(51); // LI
Terbilang
印度尼西亚文本的数字转换。
<?php use NTLAB\Lib\Common\Terbilang; echo Terbilang::getInstance()->convert(1001); // SERIBU SATU
Gelar
印度尼西亚头衔剥离器。
<?php use NTLAB\Lib\Common\Gelar; echo Gelar::strip('Drs. IHSAN SAPUTRA, M.Si'); // IHSAN SAPUTRA
身份库
NIK
NIK 编码/解码器。
<?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 编码/解码器。
<?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
NRP
NRP 编码/解码器。
<?php use NTLAB\Lib\Identity\Ids\Nrp; $nrp = new Nrp('96090050'); echo $nrp->getLahir()->format('d-m-Y'); // 01-09-1996 echo $nrp->getUrut(); // 50