1. Go to this page and download the library: Download erajkhatiwada/imb 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/ */
use Imb\IMB;
use Imb\IMBData;
// Create data object directly
$data = new IMBData(
'01', // barcodeId
'234', // serviceType
'567094', // mailerId
'987654321', // serialNum
'12345' // zip (optional)
);
$barcode = IMB::encode($data);
// Create from array (recommended)
$data = IMBData::fromArray([
'barcode_id' => '01',
'service_type' => '234',
'mailer_id' => '567094',
'serial_num' => '987654321',
]);
use Imb\Encoder;
use Imb\Decoder;
$encoder = new Encoder();
$decoder = new Decoder();
$barcode = $encoder->encode([...]);
$result = $decoder->decode($barcode);
use Imb\IMB;
$result = IMB::decode($damagedBarcode);
if ($result->wasDamaged()) {
echo "Barcode was damaged and repaired";
echo "Suggested correction: " . $result->suggest;
// $result->highlight shows which positions were corrected
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.