/php-nin

Validate structure of personal national identification numbers in PHP

Primary LanguagePHPMIT LicenseMIT

logo

National Identification Numbers

php version latest release codecov styleci

This library validates the structure of individual identification numbers. Currently supporting all Nordic countries.

Supported countries

  • Sweden
    • Personal identification numbers
    • Coordination numbers
  • Norway
    • Birth numbers
    • D-numbers
    • H-numbers
  • Finland
    • Personal identity code
  • Iceland
    • Identification number
  • Denmark
    • Personal identification number

Usage

use NIN\NationalIdentificationNumberParser;

$nin = NationalIdentificationNumberParser::tryParse('890629-1870', 'SE');
echo $nin;                   // '890629-1870'
echo $nin->getCountryCode(); // 'SE'

Installation

composer require vladdesv/php-nin

License

MIT © Vladimirs Nordholm