mirror of
https://github.com/chillerlan/php-qrcode.git
synced 2026-10-05 19:37:28 +00:00
:octocat: examples cleanup
This commit is contained in:
+11
-6
@@ -1,6 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace chillerlan\QRCodeExamples;
|
||||
/**
|
||||
* @created 03.06.2020
|
||||
* @author Maximilian Kresse
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
use chillerlan\QRCode\{QRCode, QROptions};
|
||||
use chillerlan\QRCode\Data\QRMatrix;
|
||||
@@ -8,8 +11,6 @@ use chillerlan\QRCode\Common\EccLevel;
|
||||
|
||||
require_once __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
$data = 'https://www.youtube.com/watch?v=DLzxrzFCyOs&t=43s';
|
||||
|
||||
$options = new QROptions([
|
||||
'version' => 7,
|
||||
'outputType' => QRCode::OUTPUT_FPDF,
|
||||
@@ -44,6 +45,10 @@ $options = new QROptions([
|
||||
],
|
||||
]);
|
||||
|
||||
\header('Content-type: application/pdf');
|
||||
if(php_sapi_name() !== 'cli'){
|
||||
header('Content-type: application/pdf');
|
||||
}
|
||||
|
||||
echo (new QRCode($options))->render($data);
|
||||
echo (new QRCode($options))->render('https://www.youtube.com/watch?v=dQw4w9WgXcQ');
|
||||
|
||||
exit;
|
||||
|
||||
Reference in New Issue
Block a user