PHP code example of trishanapp / lk-business-validator
1. Go to this page and download the library: Download trishanapp/lk-business-validator 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/ */
trishanapp / lk-business-validator example snippets
use Trishanapp\LkBusinessValidator\LkValidator;
// NIC
LkValidator::nic('851234567V'); // true
LkValidator::nic('198512345678'); // true (new format)
// Phone
LkValidator::phone('0771234567'); // true
LkValidator::phone('+94771234567'); // true
// Business Registration
LkValidator::br('PV00123456'); // true
LkValidator::br('PV/00123456'); // true (slash accepted)
// Postal Code
LkValidator::postalCode('00100'); // true (Colombo)
LkValidator::postalCode('80000'); // true (Galle)
// VAT / TIN
LkValidator::vat('123456789-7000'); // true
LkValidator::tin('123456789'); // true
// lang/en/validation.php
'lk_nic' => 'Please enter a valid Sri Lanka NIC number.',
'lk_phone' => 'Please enter a valid Sri Lanka phone number.',
'lk_br' => 'Please enter a valid Business Registration number.',
'lk_postal_code' => 'Please enter a valid Sri Lanka postal code.',
'lk_vat' => 'Please enter a valid VAT registration number.',
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.