Social | Legal | Release | Tests | Code |
---|---|---|---|---|
|
|
|
|
|
Detailed information about identification number of the National Register (NL: rijksregisternummer, FR: numéro de registre national) can be found at:
- https://nl.wikipedia.org/wiki/Rijksregisternummer
- https://fr.wikipedia.org/wiki/Numéro_de_registre_national
- https://www.ibz.rrn.fgov.be/fileadmin/user_upload/nl/rr/instructies/IT-lijst/IT000_Rijksregisternummer.pdf
- https://www.ibz.rrn.fgov.be/fileadmin/user_upload/fr/rn/fichier-rn/fichier-RN.pdf
Validate check digits and whether the first digits form a valid date.
echo RijksregisternummerHelper::isValid('66041066600'); // true
echo RijksregisternummerHelper::isValid('66041066601'); // false
Extract the date of birth from a registry number.
echo RijksregisternummerHelper::getBirthDay('66.64.10-666.92'); // '1966-04-10'
echo RijksregisternummerHelper::getBirthDay('40.00.01-001.33'); // null
Also constructing a new Rijksregisternummer
will throw a \UnexpectedValueException
if the number is invalid.
Use the Helper to do simple string formatting. Invalid numbers will be returned as is.
echo RijksregisternummerHelper::format('66041066600'); // '66.04.10-666.00'
Or create an instance.
$rijksregisternummer = new Rijksregisternummer('93051822361');
echo $rijksregisternummer->humanFormat(); // '93.05.18-223.61'
Clean formatting characters from user input.
echo RijksregisternummerHelper::clean('66.04.10-666.00'); // '66041066600'
The project is licensed under the MIT license.