Reputation: 2540
Is it possible to use html tag in qrcode library? I tried below code:-
header('Content-Type:text/html');
include('../QRcode/qrlib.php');
$html = '<h1><b>BMTF</b></h1>'.PHP_EOL;
$html.= '<h1>Gyldig rapport</h1>'.PHP_EOL;
$html.= '<u></u>'.PHP_EOL;
$tempDir = "QRcodePng/";
//echo QRcode::png($html);
QRcode::png($html, $tempDir.'023.png', QR_ECLEVEL_L, 3);
echo '<img src="QRcodePng/023.png" />';
and I'm getting output like below:-
<h1><b>BMTF</b></h1>
<h1>Gyldig rapport</h1>
<u></u>
Any suggestion on how to get proper scan output???
Upvotes: 2
Views: 3117
Reputation: 2100
A QR code can only store some specific data format :
If you store HTML in your QR code, it will be considered as plain text (unless your reader can read HTML). The best way to store HTML in a QR code is to put an URL in the QR Code who redirects to the HTML you want to show.
Upvotes: 2