A PHP package for MRZ (Machine Readable Zones) code parser for Passport, Visa & Travel Document (TD1 & TD2).

Overview

MRZ (Machine Readable Zones) Parser for PHP

Latest Version on Packagist Tests

A PHP package for MRZ (Machine Readable Zones) code parser for Passport, Visa & Travel Document (TD1 & TD2).

Installation

You can install the package via composer:

composer require rakibdevs/mrz-parser

Usage

use Rakibdevs\MrzParser\MrzParser;
.....
.....
$data = MrzParser::parse('P<UTOERIKSSON<<ANNA<MARIA<<<<<<<<<<<<<<<<<<<
L898902C36UTO7408122F1204159ZE184226B<<<<<10');

var_dump($data);

Output

{
    "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"
}

Supported Document

Passport (TD3)

P<UTOERIKSSON<<ANNA<MARIA<<<<<<<<<<<<<<<<<<<
L898902C36UTO7408122F1204159ZE184226B<<<<<10

Visa

V<UTOERIKSSON<<ANNA<MARIA<<<<<<<<<<<<<<<<<<<
L8988901C4XXX7408122F96121096ZE184226B<<<<<<

Or

V<UTOERIKSSON<<ANNA<MARIA<<<<<<<<<<<
L8988901C4XXX7408122F9612109<<<<<<<<

Travel Document (TD1)

I<UTOD231458907<<<<<<<<<<<<<<<
7408122F1204159UTO<<<<<<<<<<<6
ERIKSSON<<ANNA<MARIA<<<<<<<<<<

Travel Document (TD2)

I<UTOERIKSSON<<ANNA<MARIA<<<<<<<<<<<
D231458907UTO7408122F1204159<<<<<<<6

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

Special thanks to tetrahydra for organised country list, Al Amin for help extracting information.

License

The MIT License (MIT). Please see License File for more information.

You might also like...
This document provides the details related to Remittance API. This APIs is used to initiate payment request from Mobile client/others exchange house.

City Bank Remittance API This is where your description should go. Limit it to a paragraph or two. Consider adding a small example. Installation You c

PHP Machine Learning library
PHP Machine Learning library

PHP-ML - Machine Learning library for PHP Fresh approach to Machine Learning in PHP. Algorithms, Cross Validation, Neural Network, Preprocessing, Feat

A high-level machine learning and deep learning library for the PHP language.

Rubix ML A high-level machine learning and deep learning library for the PHP language. Developer-friendly API is delightful to use 40+ supervised and

Rubix ML - A high-level machine learning and deep learning library for the PHP language.

A high-level machine learning and deep learning library for the PHP language. Developer-friendly API is delightful to use 40+ supervised and

PHP Machine Learning with Naive Bayes to classify the right contraceptive based on your medical history

What is php-ml-bayes PHP-ML Bayes is a Machine Learning with Naive Bayes Algorithm to classify the right contraceptive based on your medical history.

XState - A State Machine for PHP

XState - A State Machine for PHP State machine library to play with any complex behavior of your PHP objects Installation You can install the package

Show caffeine intake stats for our office coffee machine
Show caffeine intake stats for our office coffee machine

Coffee brewing statistics for the Spatie office Over at Spatie we drink a lot of coffee. How much coffee? We had no idea until we created this dashboa

A virtual machine for executing programs written in Hack.

HHVM HHVM page | HHVM documentation | Hacklang page | General group | Dev group | Twitter HHVM is an open-source virtual machine designed for executin

A list of ICs and IPs for AI, Machine Learning and Deep Learning.
A list of ICs and IPs for AI, Machine Learning and Deep Learning.

AI Chip (ICs and IPs) Editor S.T.(Linkedin) Welcome to My Wechat Blog StarryHeavensAbove for more AI chip related articles Latest updates Add news of

Comments
Releases(v1.2.0)
  • v1.2.0(Jun 30, 2022)

    Full Changelog: https://github.com/rakibdevs/mrz-parser/compare/v1.1.0...v1.2.0

    1. Fixed Card No and First Name "<" Issue in Visa b292c6a
    2. Added Semantic Versioning

    Special Thanks to @sohelamin for the Review.

    Source code(tar.gz)
    Source code(zip)
  • v1.1.0(Jun 29, 2022)

    What's Changed

    • Fixed #1 Replace the first name arrow with space.
    • Fixed showing wrong passport number (0f66162:)
    • Validate given date format in MRZ (ede0247)

    New Contributors

    • @alaminfirdows made their first contribution in https://github.com/rakibdevs/mrz-parser/pull/2

    Full Changelog: https://github.com/rakibdevs/mrz-parser/compare/v1.0...v1.1

    Source code(tar.gz)
    Source code(zip)
  • v1.0.0(Jun 26, 2022)

Owner
Md. Rakibul Islam
PHP freak, open source project maintainer. Love to trek and play cricket.
Md. Rakibul Islam
Clean Code concepts adapted for PHP - A guide for producing readable, reusable, and refactorable PHP software

Clean Code concepts adapted for PHP - A guide for producing readable, reusable, and refactorable PHP software

Fabio Soares 172 Dec 25, 2022
DBML parser for PHP8. It's a PHP parser for DBML syntax.

DBML parser written on PHP8 DBML (database markup language) is a simple, readable DSL language designed to define database structures. This page outli

Pavel Buchnev 32 Dec 29, 2022
🦉 human-readable regular expressions for PHP

RegExpBuilder integrates regular expressions into the programming language, thereby making them easy to read and maintain. Regular Expressions are created by using chained methods and variables such as arrays or strings.

Max Girkens 907 Dec 30, 2022
Declaratively specify how to extract elements from a JSON document, in PHP

jmespath.php JMESPath (pronounced "jaymz path") allows you to declaratively specify how to extract elements from a JSON document. jmespath.php allows

null 1.7k Dec 30, 2022
The easiest way to match data structures like JSON/PlainText/XML against readable patterns. Sandbox:

PHP Matcher Library created for testing all kinds of JSON/XML/TXT/Scalar values against patterns. API: PHPMatcher::match($value = '{"foo": "bar"}', $p

Coduo 774 Dec 31, 2022
Humanize values that are readable only for developers.

PHP Humanizer Tests - 4.x Readme for 4.x version Humanize values to make them readable for regular people ;) Installation Run the following command: c

Coduo 1.5k Dec 21, 2022
This component, based on the Symfony serializer and async-aws, is a human-readable and quick abstraction to easily store serialized objects in DynamoDB 🚀.

DynamoDB Storable This component, based on the Symfony serializer and async-aws, is a human-readable and quick abstraction to easily store serialized

Matthieu W. 2 Jun 19, 2022
A wrapper around symplify/config-transformer used to update recipes and using easy coding standard for generating readable config files.

Symfony Recipes Yaml to PHP Converter This is a wrapper around the symplify/config-transformer used to convert Symfony core recipes which uses .yaml c

Alexander Schranz 3 Nov 24, 2022
Okex API Like the official document interface, Support for arbitrary extension.

It is recommended that you read the official document first Okex docs https://www.okex.com/docs/en Okex Simulation Test API https://www.okex.com/docs/

lin 34 Jan 1, 2023
A simple library for management the DOM (XML, HTML) document.

A simple library for management the DOM (XML, HTML) document.

Alexey 3 Oct 1, 2022