Inhaltsverzeichnis

getQRCodeImage()

string getQRCodeImage(string content, [int width])

Creates a QR Code with the given content and returns the HTML code for a <img> tag with this QR Code.

Application

In the following example, a QR code with a width of 150 pixels is displayed in the center of the questionnaire, which links to www.soscisurvey.de.

$img = getQRCodeImage('https://www.soscisurvey.en/', 150);
html('<div style="text-align: center; margin: 1em 0;">'.$img.'</div>');

Credits

SoSci Survey uses the library phpqrcode from Alexandre Assouad and Dominik Dzienia to generate the QR Code.