Home > Backend Development > PHP Tutorial > php generates QRcode instance, phpqrcode instance_PHP tutorial

php generates QRcode instance, phpqrcode instance_PHP tutorial

WBOY
Release: 2016-07-13 10:18:30
Original
870 people have browsed it

php generates QRcode instance, phpqrcode instance

The example in this article describes an example of generating QRcode in PHP. Is a very useful function. Share it with everyone for your reference. The details are as follows:

The example demonstration effect is shown in the figure below:

The main function codes are as follows:

<&#63;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 '<img src="'.$PNG_WEB_DIR.basename($filename).'" />'; 
&#63;>  
Copy after login

PHP QRcode Lib click here to download from this website.

I hope this article will be helpful to everyone’s PHP programming design.

How to make the output result line wrap when using phpqrcode to generate a QR code

Just like in PHP, use \r to separate

Several ways to generate QR code in php

.altmi.com';//Generated file name $filename=$errorCorrectionLevel.'|'.$matrixPointSize.'.png';//Error correction level: L, M, Q, H$errorCorrectionLevel=' L';//Point size: 1 to 10$matrixPointSize=4;QRcode::png($data,$filename,$errorCorrectionLevel,$matrixPointSize,2);Official use case:

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/882908.htmlTechArticlephp generates QRcode examples, phpqrcode examples This article tells the example of php generating QRcode examples. Is a very useful function. Share it with everyone for your reference. The details are as follows: Example demonstration effect...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template