PHP code example of bakhodir / passport-scanner

1. Go to this page and download the library: Download bakhodir/passport-scanner 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/ */

    

bakhodir / passport-scanner example snippets


use PassportScanner\MRZScanner;

$mrzScanner= new MRZScanner();

$mrzScanner
    ->json() //parse result as json
    ->setFile('filepath/passport.jpg') //set the path of image
    ->execute(); //execute a command

$result = $mrzScanner->getResult(); // string/array
$isValid = $mrzScanner->isValid(); ///bool
$score = $mrzScanner->getScore(); //score of the result 0-100