Using the PHP QR code two-dimensional code class to generate a two-dimensional code

Source: Internet
Author: User
Tags php class

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 '  ';    
? >

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.