PHP code example of reyesoft / crypto-qr

1. Go to this page and download the library: Download reyesoft/crypto-qr 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/ */

    

reyesoft / crypto-qr example snippets


use Reyesoft\CryptoQr\BitcoinQr;

$qr = new BitcoinQr('3PrCdjyjcDHDSC8tvVgx1u96tMK9juncHs');

header('Content-Type: '.$qr->getQrCode()->getContentType());
echo $qr->getQrCode()->writeString();

use Reyesoft\CryptoQr\BitcoinQr;

// Create a basic QR code
$qr = new BitcoinQr('3PrCdjyjcDHDSC8tvVgx1u96tMK9juncHs');
$qr->getQrCode()->setSize(300);
$qr->setAmount(0.01);
$qr->setLabel('Caritas');
$qr->setMessage('Donation for project Maria');

// Directly output the QR code
header('Content-Type: '.$qr->getQrCode()->getContentType());
echo $qr->getQrCode()->writeString();

// Save it to a file
$qr->getQrCode()->writeFile(__DIR__.'/qrcode.png');