Initial release

This commit is contained in:
Frank Bischof 2023-01-09 14:28:28 +01:00
parent e864304465
commit 020e1d8a07
2 changed files with 28 additions and 2 deletions

View File

@ -1,2 +1,5 @@
# php_qr_generator
QR Generator PHP (via Google Charts)
# QR Generator PHP (via Google Charts)
Fairly simple function.
Just change the $DATA variable to whatever you want to request a QR image via Google Charts.

23
generate_qr.php Normal file
View File

@ -0,0 +1,23 @@
<?php
/*
* Author: F. Bischof (info@meer-web.nl)
* Version: 1.0
*
* More info: https://developers.google.com/chart/infographics/docs/qr_codes
*/
function QR() {
$URL_ROOT = 'https://chart.googleapis.com/chart';
$TYPE = 'qr'; // QR
$SIZE = '250x250'; // Size QR
$ENCODING = 'UTF-8'; // Encoding
global $DATA; // Data
$URL_FULL = "<img src='${URL_ROOT}?cht=${TYPE}&chs=${SIZE}&chl=${DATA}&choe=${ENCODING}'>";
return $URL_FULL;
}
$DATA = 'Hi Mothergoose';
echo QR();
?>