Skip to content

Package to parse and validate South African ID Numbers.

License

Notifications You must be signed in to change notification settings

talifhani/za-id-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

South African Personal ID Parser/Validator

Package to parse and validate South African ID Numbers.

Installing

$ composer require talifhani/za-id-parser -vvv

Usage

use Talifhani\ZaIdParser\IDNumberParser;
$idNumberData = (new  IDNumberParser($idNum))->parse();

echo  "ID Number: ".$idNumberData->getIdNumber()."<br />";
echo  "Birthdate: ".$idNumberData->getBirthdate()."<br />";
echo  "Age: ".$idNumberData->getAge()."<br />";
echo  "Citizenship: ".$idNumberData->getCitizenship()."<br />";
echo  "Gender: ".$idNumberData->getGender()."<br />";
echo  "Is Valid ID: ".($idNumberData->isValid() ? 'Yes' : 'No');

print_r($idNumberData->toArray());
/*
(
    [birthdate] => 1988-09-15
    [age] => 30
    [gender] => Female
    [citizenship] => South African
    [valid] => 1
)
*/

Contributing

You can contribute in one of three ways:

  1. File bug reports using the issue tracker.
  2. Answer questions or fix bugs on the issue tracker.
  3. Contribute new features or update the wiki.

The code contribution process is not very formal. You just need to make sure that you follow the PSR-0, PSR-1, and PSR-2 coding guidelines. Any new code contributions must be accompanied by unit tests where applicable.

License

MIT

About

Package to parse and validate South African ID Numbers.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages