Home > php教程 > php手册 > body text

php生成QRcode实例,phpqrcode实例

WBOY
Release: 2016-06-13 09:25:03
Original
941 people have browsed it

php生成QRcode实例,phpqrcode实例

本文实例讲述了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实例,phpqrcode实例" >'; 
&#63;>  
Copy after login

PHP QRcode Lib点击此处本站下载。

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

用phpqrcode生成的二维码,怎让输出结果换行

如PHP里 一样 用\r分割
 

php生成二维码的几种方式

.altmi.com';//生成的文件名$filename=$errorCorrectionLevel.'|'.$matrixPointSize.'.png';//纠错级别:L、M、Q、H$errorCorrectionLevel='L';//点的大小:1到10$matrixPointSize=4;QRcode::png($data,$filename,$errorCorrectionLevel,$matrixPointSize,2);官方给出的用例:  

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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!