Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Latest commit

 

History

History
27 lines (19 loc) · 682 Bytes

README.md

File metadata and controls

27 lines (19 loc) · 682 Bytes

mrz-parser

Library to parse machine readable zones (MRZ) of passports and travel documents

Usage

Usage is straightforward:

<?php

$mrz = "P<UTOERIKSSON<<ANNA<MARIA<<<<<<<<<<<<<<<<<<<L898902C<3UTO6908061F9406236ZE184226B<<<<<14";

// Parse string
$parser = new Deft\MrzParser\MrzParser();
$travelDocument = $parser->parseString($mrz);

// Use getters to access the parsed information
print $travelDocument->getDocumentNumber(); // Will print 'L898902C'

// Parse array of lines
$mrz = [
    "P<UTOERIKSSON<<ANNA<MARIA<<<<<<<<<<<<<<<<<<<",
    "L898902C<3UTO6908061F9406236ZE184226B<<<<<14"
];
$travelDocument = $parser->parseLines($mrz);