Download the PHP package frozzare/personnummer without Composer
On this page you can find all versions of the php package frozzare/personnummer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download frozzare/personnummer
More information about frozzare/personnummer
Files in frozzare/personnummer
Download frozzare/personnummer
More information about frozzare/personnummer
Files in frozzare/personnummer
Vendor frozzare
Package personnummer
Short Description Validate Swedish social security numbers
License MIT
Package personnummer
Short Description Validate Swedish social security numbers
License MIT
Please rate this library. Is it a good library?
Informations about the package personnummer
personnummer
Validate Swedish social security numbers.
Installation
Methods
Static
Method | Arguments | Returns |
---|---|---|
parse | string personnummer, [ array options* ] | Instance |
valid | string personnummer, [ array options* ] | bool |
Instance
Method | Arguments | Returns |
---|---|---|
format | bool longFormat | string |
getAge | none | int |
isMale | none | bool |
isFemale | none | bool |
isCoordinationNumber | none | bool |
isInterimNumber | none | bool |
getDate | none | DateTime |
Property | Type | Description |
---|---|---|
century | string | Century, two digits |
year | string | Year, two digits |
fullYear | string | Year, four digits |
month | string | Month, two digits |
day | string | Day, two digits |
sep | string | Separator (-/+) |
num | string | Suffix number, three digits |
check | string | Luhn check digit, one digit |
Errors
When a personnummer is invalid a PersonnummerException is thrown.
Options
Option | Type | Default | Description |
---|---|---|---|
allowCoordinationNumber | bool | true | Accept coordination numbers |
allowInterimNumber | bool | false | Accept interim/T numbers |
Examples
Validation
Format
Get Age
Get Sex
See PersonnummerTest.php for more examples.
License
MIT
All versions of personnummer with dependencies
PHP Build Version
Package Version
Requires
php Version
>=8.1
The package frozzare/personnummer contains the following files
Loading the files please wait ....