Two-dimensional code online generation of images PHP source code
QR code is now becoming more and more popular, here is the two-dimensional code generated by PHP code, a use of Google's open QR Code API, another section of the use of PHP QR code two-dimensional open source class library, are very simple.
1. Using Google Chart API to generate two-dimensional code images
Google Chart API is a very powerful API, the generation of QR code is just one of the small features. Here only the two-dimensional code section, if you want to learn more features, you can login to the official website address: http://code.google.com/intl/zh-CN/apis/chart/
The code is as follows:
$urlToEncode = "Http://www.weste.net";
Generateqrfromgoogle ($urlToEncode);
function Generateqrfromgoogle ($chl, $widhtHeight = ' Max ', $EC _level= ' L ', $margin = ' 0 ')
{
$url = UrlEncode ($url);
Echo ';
}
?>
Generated two-dimensional code image:
2. Using PHP QR code to generate two-dimensional code images
PHP QR Code is an open source PHP two-dimensional code open source class library, based on the Libqrencode C library, and provides API code to create QR barcode images, support PNG, JPG format. Powerful and easy to use.
The demo code is as follows:
Include "./phpqrcode/phpqrcode.php";
$value = "Http://www.weste.net";
$errorCorrectionLevel = "L";
$matrixPointSize = "4";
QRCode::p ng ($value, False, $errorCorrectionLevel, $matrixPointSize);
Exit
?>
Generated two-dimensional code image:
http://www.bkjia.com/PHPjc/834967.html www.bkjia.com true http://www.bkjia.com/PHPjc/834967.html techarticle Two-dimensional code on-line generation of images PHP source code QR Code is now becoming more and more popular, here is the two-dimensional code to introduce PHP code generation, a use of Google open QR Code API, another section ...