PHP code example of softhublk / sl-nic-number

1. Go to this page and download the library: Download softhublk/sl-nic-number 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/ */

    

softhublk / sl-nic-number example snippets

 php


ub\SlNicNumber\Nic;

$nic = new Nic('991234567v');

echo 'NIC Type' . $nic->getCategory()->value . '<br>';

echo "Gender : {$nic->getGender()->value} <br>";

echo "Date Of Birth : {$nic->getDateOfBirth()->format('Y-m-d')}<br>";

echo 'Born day of the year ' . $nic->getBornDayOfTheYear() . '<br>';