1. Go to this page and download the library: Download avdeb/qr-php 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/ */
avdeb / qr-php example snippets
Avdeb\QrPhp\QRCodeGenerator;
$qr = new QRCodeGenerator(['size' => 8, 'margin' => 4, 'errorCorrection' => 'M']);
// Format follows the extension: .svg or .png
if (!$qr->generate('https://example.com', __DIR__ . '/example.png')) {
echo "Could not write file\n";
}
$qr->generate('https://example.com', __DIR__ . '/example.svg');