1. Go to this page and download the library: Download bishopbd/aamva-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/ */
bishopbd / aamva-parser example snippets
use AamvaParser\Parser;
$result = (new Parser())->parse($scannerData);
echo $result['first'];
echo $result['last'];
echo $result['address'];
$json = json_encode($result, JSON_THROW_ON_ERROR);
$document = (new Parser())->parseDocument($scannerData);
$normalized = $document->normalized(); // Same result as parse().
$allFields = $document->elements(); // Every designator and repeated value.
$documentNumber = $document->value('DAQ');
$metadata = $document->metadata(); // IIN, version/year, and subfile count.
$subfiles = $document->subfiles(); // Fields retain subfile provenance.
$warnings = $document->warnings(); // Non-fatal structural/version issues.
use AamvaParser\DataHandler;
$handler = new DataHandler();
$rawFromHex = $handler->fromByteString($hexByteString);
$rawFromBase64 = $handler->base64Decode($base64String);