vladdesv/php-nin

Verify structure of individual national identification numbers

1.0.0 2020-05-01 17:13 UTC

This package is auto-updated.

Last update: 2024-09-06 16:56:17 UTC


README

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