Home > Backend Development > PHP Tutorial > php生成QRcode实例_php技巧

php生成QRcode实例_php技巧

WBOY
Release: 2016-05-16 20:36:01
Original
1214 people have browsed it

本文实例讲述了php生成QRcode实例。是一个非常有用的功能。分享给大家供大家参考。具体如下:

实例演示效果如下图所示:

主要功能代码如下:

<&#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).'" / alt="php生成QRcode实例_php技巧" >'; 
&#63;>  
Copy after login

PHP QRcode Lib点击此处本站下载

希望本文所述对大家的php程序设计有所帮助。

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