sample_custom.php 450 B

12345678910111213141516171819202122
  1. <?php
  2. require_once '../vendor/autoload.php';
  3. use codemasher\QRCode\QRCode;
  4. use codemasher\QRCode\QRConst;
  5. $qrcode = new QRCode;
  6. $qr = $qrcode->getMinimumQRCode('イメージ作成(引数:サイズ,マージン', QRConst::ERROR_CORRECT_LEVEL_L);
  7. header('Content-type: text/plain');
  8. $m = $qr->getModuleCount();
  9. for($row = 0; $row < $m; $row++){
  10. for($col = 0; $col < $m; $col++){
  11. echo $qr->isDark($row, $col) ? '#' : ' ';
  12. }
  13. echo PHP_EOL;
  14. }