Translations of this page:
 

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.

  • content
    The text to be encoded in the QR Code, e.g. an internet address
  • width
    The maximum width in pixels that the image should have

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.

en/create/functions/getqrcodeimage.txt · Last modified: 26.11.2020 20:33 by sophia.schauer
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
Driven by DokuWiki