QR code is a common two-dimensional code, which is used to record data information with a specific geometry on a plane. The QR principle is more complicated to understand, and it takes a lot of time to deal with it yourself. Here we recommend a PHP class library that generates QR code, PHP qr code. I've used it myself, and I haven't found any problems to share with you.
Download Address: http://download.csdn.net/detail/u011986449/6865449
QR code
Data represents the number of records to be recorded, if it is stored utf-8 encoded in Chinese, up to 984.
ECC indicates the level of error correction, the higher the level of error correction, the larger the picture will be generated.
L level 7% codewords can be modified
m level 15% codewords can be modified
Q level 25% codewords can be modified by
H level 30% codewords can be modified
Size represents the pixels of each black dot in a picture.
QR Code detailed principle can refer to QR Wikipedia, the Chinese version introduction is relatively few, the English version introduction is very comprehensive, the recommendation looks English edition
Sweep the two-dimensional code below and try!
The code is:
<?php
ini_set (' display_errors ', ' on ');
$PNG _temp_dir = dirname (__file__). Directory_separator. ' Temp '. Directory_separator;
$PNG _web_dir = ' temp/';
Include "qrlib.php"; QRCode lib
$data = ' http://blog.csdn.net/phpfenghuo?viewmode=contents ';//data
$ECC = ' H ';//L-smallest, M, Q , h-best
$size =//1-50
$filename = $PNG _temp_dir. ' Qrcode_ '. Time (). PNG ';
QRCode::p ng ($data, $filename, $ECC, $size, 2);
chmod ($filename, 0777);
Echo ' ';
? >