I am using this awesome feature of phpqrcode (https://sourceforge.net/projects/phpqrcode/) to dynamically generate QR Code:
<?php
// Include the qrlib file
include './phpqrcode/qrlib.php';
// $text variable has data for QR
$text = "Hello World!";
// QR Code generation using png()
// When this function has only the
// text parameter it directly
// outputs QR in the browser
QRcode::png($text);
?>
The last line of code QRcode::png($text);
is where the magic happens. When provided only with a single argument ($text
), it directly displays the QR code in the browser WITHOUT saving the PNG file into the webserver directory.
It comes in various options, like QRcode::png($text, $file_name, QR_ECLEVEL_L,10,3);
allow for resizing the image size to a higher magnitude (argument value 10), and change the margin (argument value 3).
However, these option require saving the PNG file of the QR code on the webserver directory (hence the argument $file_name
needed), which obviously consumes a lot of webserver space.
I am looking for option where using QRcode::png($text);
option (which DOES NOT save the PNG file on webserver directory), to enable me to change the size of the QR code image as displayed in the browser.
Anyone has any inputs to get that please?