MRZ for PHP
Machine Readable Zone for PHP, originally based on mrz
Via Composer
composer require alphaolomi/mrz
use Alphaolomi\Mrz\Mrz;
$mrz = new Mrz("I", "Tanzania", "D23148958907", date("dmy",strtotime("1999-10-14")), "M", date("dmy",strtotime("2030-12-31")), "TZA", "OLOMI", "ALPHA");
echo $mrz->TD1CodeGenerator();
use Alphaolomi\Mrz\MrzParser;
$mrzParser = new MrzParser();
$mrzOcrString = 'PTUNKKONI<<MARTINA<<<<<<<<<<<<<<<<<<<<<<<<<<K0503499<8UNK9701241F06022201170650553<<<<10';
$mrzData = $mrzParser->parse($mrzOcrString);
print(json_encode($mrzData, JSON_PRETTY_PRINT));
-
TD1
I<UTOD231458907<<<<<<<<<<<<<<< 7408122F1204159UTO<<<<<<<<<<<6 ERIKSSON<<ANNA<MARIA<<<<<<<<<<
-
TD2
I<UTOERIKSSON<<ANNA<MARIA<<<<<<<<<<< D231458907UTO7408122F1204159<<<<<<<6
-
TD3
P<UTOERIKSSON<<ANNA<MARIA<<<<<<<<<<<<<<<<<<< L898902C36UTO7408122F1204159ZE184226B<<<<<14
-
MRV
V<UTOERIKSSON<<ANNA<MARIA<<<<<<<<<<<<<<<<<<< L8988901C4XXX4009078F96121096ZE184226B<<<<<<
Unit tests are written with PHPUnit.
composer test
- Evandro Kondrat Original Author
- Alpha Olomi
- Nascent Michael
- All Contributors
The MIT License (MIT). Please see License File for more information.