Initial release
This commit is contained in:
parent
e864304465
commit
020e1d8a07
@ -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
23
generate_qr.php
Normal 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();
|
||||||
|
|
||||||
|
?>
|
Reference in New Issue
Block a user