Php generates a QRcode instance, phpqrcode instance _ PHP Tutorial

Source: Internet
Author: User
Php generates a QRcode instance and a phpqrcode instance. Php generates a QRcode instance. phpqrcode instance this article describes the QRcode instance generated by php. Is a very useful feature. Share it with you for your reference. The example demonstrates how to generate a QRcode instance and a phpqrcode instance using php.

This example describes how to generate a QRcode instance using php. Is a very useful feature. Share it with you for your reference. The details are as follows:

Shows the instance demo effect:

The main function code is as follows:

<?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 = 'demo qrcode'; // data $ecc = 'H'; // L-smallest, M, Q, H-best $size = 10; // 1-50  $filename = $PNG_TEMP_DIR.'qrcode_'.time().'.png'; QRcode::png($data, $filename, $ecc, $size, 2); chmod($filename, 0777); echo ''; ?>  

Click here to download PHP QRcode Lib.

I hope this article will help you with php programming.


How can I wrap the output result with a QR code generated by phpqrcode?

Use \ r as in PHP.

Php QR code generation methods

.Altmi.com '; // generated file name $ filename = $ errorCorrectionLevel. '| '.w.matrixpointsize.'.png'; // error correction level: L, M, Q, H $ errorCorrectionLevel = 'l'; // vertex size: 1 to 10 $ matrixPointSize = 4; QRcode:: png ($ data, $ filename, $ errorCorrectionLevel, $ matrixPointSize, 2); official use cases:

Examples in this article describes how to generate a QRcode instance using php. Is a very useful feature. Share it with you for your reference. The details are as follows: the instance demo effect...

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.