This is to understand how to generate QR code for a website. The following is simple QR Code generator with PHP and Google API. You can scan the QR Image using a Mobile device to get the website address. This is so common now a days to store some information relating to a product information or some other else.

You can scan the above image to see the result. But, you need to install QR Code Scanner App to scan and get the information of the above Image. The following code helps you to understand how to generate QR Code for you website.

Code for QR Code in PHP with Google API

$width = $height = 100;
$url = urlencode("");
$error = "H"; // handle up to 30% data loss, or "L" (7%), "M" (15%), "Q" (25%)
echo "<img src=\"".
 "chs={$width}x{$height}&cht=qr&chld=$error&chl=$url\" />";