Skip to content

Instantly share code, notes, and snippets.

@ScottPhillips
Created February 1, 2011 20:55
Show Gist options
  • Save ScottPhillips/806649 to your computer and use it in GitHub Desktop.
Save ScottPhillips/806649 to your computer and use it in GitHub Desktop.
Create a QR Code using PHP and Google
function createQR($url,$size ='150',$evLevel='L',$margin='0') {
$url = urlencode($url);
return '<img src="http://chart.apis.google.com/chart?chs=' . $size . 'x' . $size . '&cht=qr&chld=' . $evLevel . '|' . $margin . '&chl=' . $url . '" alt="QR code" width="' . $size . '" height="' . $size . '"/>';
}
echo createQR('http://www.wickedbrilliant.com',150);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment