1. Go to this page and download the library: Download rakibdevs/mrz-parser library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
rakibdevs / mrz-parser example snippets
use Rakibdevs\MrzParser\MrzParser;
.....
.....
$data = MrzParser::parse('P<UTOERIKSSON<<ANNA<MARIA<<<<<<<<<<<<<<<<<<<
L898902C36UTO7408122F1204159ZE184226B<<<<<10');
var_dump($data);
$mrz = MrzParser::read($text);
$mrz->cardNo; // 'L898902C3'
$mrz->fullName(); // 'ANNA MARIA ERIKSSON'
$mrz->dateOfBirthAsDate(); // DateTimeImmutable
$mrz->isExpired(); // bool (or null when the format has no expiry)
$mrz->valid; // bool
$mrz->toArray(); // the canonical parse() array