adaptivemedia / pnr
Handles and formats swedish personnummer
Installs: 30 122
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 8
Forks: 0
Open Issues: 0
Requires
- php: >=7.1.0
Requires (Dev)
- phpunit/phpunit: ^6.0
- squizlabs/php_codesniffer: ^3.1
This package is auto-updated.
Last update: 2024-10-27 23:33:26 UTC
README
This package let's you format Swedish national identification numbers.
Install
Via Composer
$ composer require adaptivemedia/pnr
Usage
require_once 'vendor/autoload.php'; // Short format... $pnr = '198306030217'; $pnrService = new SwedishPersonalNumber($pnr); $formattedIdentificationNumber = $pnrService->format(); // 830603-0217 // Long format... $formatter = SwedishPersonalNumber::FORMAT_LONG; $pnrService = new SwedishPersonalNumber('830603-0217', new $formatter); $formattedIdentificationNumber = $pnrService->format(); // 19830603-0217
Testing
$ phpunit
License
The MIT License (MIT). Please see License File for more information.