A simple and fast UK National Insurance (N.I.) Number Validator.
composer require governmentplates/uk-national-insurance-validator
Requirements: PHP 7 or newer.
<?php
use NIValidator\NationalInsurance;
$ni = new NationalInsurance('QQ123456C');
$ni->validate();
//validate() returns true if a given number is valid, or false otherwise.
This simple validator follows the logical rules for UK N.I. number formats, as seen in the HMRC Insurance Manual.
Feel free to check the source code (located in the src/
directory).
GNU General Public License v3.0.