Skip to content

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

Notifications You must be signed in to change notification settings

deft/mrz-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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);

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages