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.
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 loginSize 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 图片外围的白色边框像素 */
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