Php generates QR code in several ways and uses instances

Source: Internet
Author: User

1. Open APIs for google Copy codeThe Code is as follows: $ urlToEncode = "http://bbs.lewanchina.com ";
GenerateQRfromGoogle ($ urlToEncode );
Function generateQRfromGoogle ($ chlorophyll, $ widhtHeight = '000000', $ EC_level = 'l', $ margin = '0 ')
{
$ Url = urlencode ($ url );
Echo ' ';
}


2. php QR Code library

Php qr Code is open source (LGPL) library for generating QR Code,
2-dimen1_barcode. Based on libqrencode C library,
Provides API for creating QR Code barcode images (PNG, JPEG thanks to GD2 ).
Implemented purely in PHP, with no external dependencies (effect GD2 if needed ).
Address: http://phpqrcode.sourceforge.net/
Download: http://sourceforge.net/projects/phpqrcode/
Instance:Copy codeThe Code is as follows: <?
Include "./phpqrcode. php ";
$ Value = "http://www.weste.net ";
$ ErrorCorrectionLevel = "L ";
$ MatrixPointSize = "4 ";
QRcode: png ($ value, false, $ errorCorrectionLevel, $ matrixPointSize );
Exit;
?>

Home address: Workshop.

Data indicates the Data to be recorded. A maximum of 984 UTF-8 encoded Chinese characters can be stored.
ECC indicates the error correction level. The higher the error correction level, the larger the image to be generated.
L horizontal 7% code can be corrected
The M-level 15% code can be corrected.
Q level 25% code can be corrected
The H-level 30% font Size can be corrected to indicate the pixels of each black spot in the image.
Code call example:Copy codeThe Code is as follows: include "qrlib. php ";
QRcode: png ($ data, $ filename, $ errorCorrectionLevel, $ matrixPointSize, $ margin );
/*
$ Data
$ Name of the image saved by filename
$ ErrorCorrectionLevel error handling level
$ MatrixPointSize pixels of each black spot
$ White border pixels on the periphery of the margin Image
*/

For details about the QR code, refer to the QR Wikipedia. The Chinese version is rarely described. The English version is very comprehensive. We recommend that you read the English version.
In addition, QR codes already have a color version and can be embedded with personalized images. I have done some research in this area. If you are interested, please contact me. For my contact email address, see the column on the right of the website.

3. libqrencode
Address: http://fukuchi.org/works/qrencode/index.en.html
Php support see: http://hirokawa.netflowers.jp/entry/4900/

4. QRcode Perl CGI & PHP scripts
Address: http://www.swetake.com/qr/qr_cgi.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.