It seems like QR codes are about to go mainstream, since I’m hearing about it all the time. They’re actually pretty cool, allowing you to provide an image, that when scanned with any number of mobile phones, will take you directly to a website or provide you with some information. Luckily enough, with a little PHP and some help from Google they’re super easy to generate.
Here’s the Code:
|
1 2 3 4 5 6 |
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); |
That would generate a QR Code that looks like this:
Lemme know if you have any questions, otherwise enjoy!