Skip to content

Latest commit

 

History

History
32 lines (22 loc) · 1.15 KB

README.md

File metadata and controls

32 lines (22 loc) · 1.15 KB

PHP-NIValidator

A simple and fast UK National Insurance (N.I.) Number Validator.

License Dependents

Installation

composer require governmentplates/uk-national-insurance-validator

Requirements: PHP 7 or newer.

Usage

<?php

use NIValidator\NationalInsurance;

$ni = new NationalInsurance('QQ123456C');
$ni->validate();

//validate() returns true if a given number is valid, or false otherwise.

How does it validate a N.I number?

This simple validator follows the logical rules for UK N.I. number formats, as seen in the HMRC Insurance Manual.

Is this safe? Is this going to leak my/or my users N.I. numbers?

Feel free to check the source code (located in the src/ directory).

License

GNU General Public License v3.0.