Simple package to validate Sri Lankan NIC number
Via Composer
$ composer require softhublk/sl-nic-number
<?php
require 'vendor/autoload.php';
use Softhub\SlNicNumber\Nic;
$nic = new Nic('991234567');
if ($nic->isValid){ //validate nic
echo ("valid nic <br>");
echo ("Nic Number : ". $nic->nic . "<br>"); //convert 12 digit number automatically
echo ("Gender :" . $nic->getGender() . "<br>"); //get inc owner gender
echo ("Date Of birth : ". $nic->getBirthDay() . "<br>"); //get owner birthday
}else{
echo "invalid Nic";
}
Please see CHANGELOG for more information on what has changed recently.
$ composer test
Please see CONTRIBUTING and CODE_OF_CONDUCT for details.
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.