<?php//introduced Phpqrcode class library//phpqrcode:https://github.com/t0k4rt/phpqrcoderequire_once "phpqrcode/qrlib.php";// The first (lack of saving in the Web page to generate a QR code)//Call the PNG static method under the QRCode class QRCode::p ng ("This is a QRCode"), $content = "This is a qrcode";//content $filename = time ( ) . ". png";//File name $level = qr_eclevel_l;//fault tolerance level $size = 10;//size $padding = 3;//margin//second (custom generated QR code in Web page) QRCode::p ng ($content, False, $level, $size, $padding, true);//The third (custom-generated QR code is saved as a picture file) QRCode::p ng ($content, $filename, $level, $size, $ padding, true);/* Fault tolerance level qr_eclevel_l is a constant 0 approximately error-correcting 7% data code word qr_eclevel_m is a constant 1 about the error correction 15% of the data code word QR_ECLEVEL_Q is a constant 2 about the error correction 25% data code word qr_ Eclevel_h is a constant 3 about 30% of the data code Word error */?>
This article is from the "tong707 blog" blog, make sure to keep this source http://tong707.blog.51cto.com/12527988/1955424
PHP generates qrcode QR code