A PHP package for MRZ (Machine Readable Zones) code parser for Passport, Visa & Travel Document (TD1 & TD2).
You can install the package via composer:
composer require rakibdevs/mrz-parser
use Rakibdevs\MrzParser\MrzParser;
.....
.....
$data = MrzParser::parse('P<UTOERIKSSON<<ANNA<MARIA<<<<<<<<<<<<<<<<<<<
L898902C36UTO7408122F1204159ZE184226B<<<<<10');
var_dump($data);
{
"type": "Passport",
"card_no": "L898902C3",
"issuer": "Utopian",
"date_of_expiry": "2012-04-15",
"first_name": "ANNA MARIA",
"last_name": "ERIKSSON",
"date_of_birth": "1974-08-12",
"gender": "Female",
"personal_number": "ZE184226B",
"nationality": "Utopian"
}
P<UTOERIKSSON<<ANNA<MARIA<<<<<<<<<<<<<<<<<<<
L898902C36UTO7408122F1204159ZE184226B<<<<<10
V<UTOERIKSSON<<ANNA<MARIA<<<<<<<<<<<<<<<<<<<
L8988901C4XXX7408122F96121096ZE184226B<<<<<<
Or
V<UTOERIKSSON<<ANNA<MARIA<<<<<<<<<<<
L8988901C4XXX7408122F9612109<<<<<<<<
I<UTOD231458907<<<<<<<<<<<<<<<
7408122F1204159UTO<<<<<<<<<<<6
ERIKSSON<<ANNA<MARIA<<<<<<<<<<
I<UTOERIKSSON<<ANNA<MARIA<<<<<<<<<<<
D231458907UTO7408122F1204159<<<<<<<6
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
Special thanks to tetrahydra for organised country list, Al Amin for help extracting information.
The MIT License (MIT). Please see License File for more information.