Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ivantcholakov/egn
A PHP class for validation and generation of EGN (personal identification numbers for Bulgarian citizens)
https://github.com/ivantcholakov/egn
bulgarian-citizens egn php
Last synced: about 1 month ago
JSON representation
A PHP class for validation and generation of EGN (personal identification numbers for Bulgarian citizens)
- Host: GitHub
- URL: https://github.com/ivantcholakov/egn
- Owner: ivantcholakov
- Created: 2013-10-03T06:59:14.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2022-08-26T18:49:45.000Z (about 2 years ago)
- Last Synced: 2024-10-02T08:14:07.485Z (about 1 month ago)
- Topics: bulgarian-citizens, egn, php
- Language: PHP
- Size: 22.5 KB
- Stars: 6
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Egn.php
=======A PHP class for validation and generation of EGN (personal identification numbers for Bulgarian citizens)
Examples:
```php
// EGN generation, for testing purposes.
$egn = Egn::generate();
echo $egn;
// Sample result: 9509125507
// The result is a random valid EGN, not necessarily a real person posseses it.echo '
';$egn = '9306295605';
$is_valid = Egn::valid($egn);
// $is_valid should be TRUE as a result.
echo $egn.' - '.($is_valid ? 'Valid' : 'Invalid');echo '
';$egn = '9306295606';
$is_valid = Egn::valid($egn); // Boolean result
// $is_valid should be FALSE as a result.
echo $egn.' - '.($is_valid ? 'Valid' : 'Invalid');echo '
';$egn = '9306295605';
$burthday = Egn::get_birthday($egn);
// $burthday should be 1993-06-29
echo $egn.' - Birthday is '.$burthday;echo '
';$egn = '9306295605';
$gender = Egn::get_gender($egn);
// $gender should be 'm' as a result ('m' for male, 'f' for female).
echo $egn.' - Gender is '.$gender;echo '
';
```Links:
http://georgi.unixsol.org/programs/egn.php
http://georgi.unixsol.org/diary/archive.php/2006-09-29