text.php 599 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. /**
  3. *
  4. * @filesource text.php
  5. * @created 21.12.2017
  6. * @author Smiley <smiley@chillerlan.net>
  7. * @copyright 2017 Smiley
  8. * @license MIT
  9. */
  10. use chillerlan\QRCode\{QRCode, QROptions};
  11. require_once __DIR__.'/../vendor/autoload.php';
  12. $data = 'https://www.youtube.com/watch?v=DLzxrzFCyOs&t=43s';
  13. $options = new QROptions([
  14. 'version' => 5,
  15. 'outputType' => QRCode::OUTPUT_STRING_TEXT,
  16. 'eccLevel' => QRCode::ECC_L,
  17. ]);
  18. // <pre> to view it in a browser
  19. echo '<pre style="font-size: 75%; line-height: 1;">'.(new QRCode($options))->render($data).'</pre>';