Introduction to the use of PHP QR Code, a class library for generating QR codes_PHP tutorial

WBOY
Release: 2016-07-14 10:07:36
Original
759 people have browsed it

QR codes are used to record data information with specific geometric figures on a flat surface. QR codes are a common two-dimensional code. The QR principle is relatively complicated to understand. If you deal with it yourself, it will probably take a lot of time. Here is a PHP QR Code library for generating QR codes. I have been using this myself for more than a year and have not found any problems, so I would like to share it with you.

Home page address: http://phpqrcode.sourceforge.net/. You can download the source code directly from the site. After downloading, extract it to the web directory and access it through the web page to see the demo.

Introduction to the use of PHP QR Code, a class library for generating QR codes_PHP tutorial

QR code

Data represents the data to be recorded. If it is to store UTF-8 encoded Chinese, the maximum number is 984.
ECC represents the error correction level. The higher the error correction level, the larger the generated image will be.

L水平    7%的字码可被修正
M水平    15%的字码可被修正
Q水平    25%的字码可被修正
H水平    30%的字码可被修正
Copy after login

Size represents the pixels of each black point in the image.

Code calling example:

include "qrlib.php"; 
QRcode::png($data, $filename, $errorCorrectionLevel, $matrixPointSize, $margin); 
/*
    $data 数据
    $filename 保存的图片名称
    $errorCorrectionLevel 错误处理级别
    $matrixPointSize 每个黑点的像素
    $margin 图片外围的白色边框像素
*/
Copy after login

For the detailed principles of QR code, you can refer to QR Wikipedia. The Chinese version has relatively few introductions, but the English version has a very comprehensive introduction. It is recommended to read the English version

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/477850.htmlTechArticleQR code is used to record data information with specific geometric figures on a flat surface. QR code is a common one. kind of QR code. The QR principle is relatively complicated to understand. If you deal with it yourself, it will probably cost a lot of money...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template