-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexample.php
More file actions
25 lines (15 loc) · 710 Bytes
/
Copy pathexample.php
File metadata and controls
25 lines (15 loc) · 710 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?php
/*
Composer installation (run in your project):
composer require github.com/janmz/qrcodesvg:dev-main
This will include the dependency qrcode-generator/qrcode.php which is updated via a githup workflow to avoid distributing the complete package.
*/
require __DIR__ . '/vendor/autoload.php';
// Minimal example: generate an SVG QR code
$text = 'Hello from QRCodeSVG via Composer';
// Build a minimal QR first using the base API
$qr = QRCodeSVG::getMinimumQRCode($text, QR_ERROR_CORRECT_LEVEL_H);
// Render as SVG (width, foreground, background, alt text, variation)
$svg = $qr->getSVG(256, '#000', '#ffffff00', 'QR Code example', 'rounded');
header('Content-Type: image/svg+xml');
echo $svg;