<?php
//引入 phpqrcode 类库
//phpqrcode下载地址:https://github.com/t0k4rt/phpqrcode
require_once "phpqrcode/qrlib.php";
//第一种(缺省下在网页中生成二维码)
//调用QRCode类下的png静态方法
QRcode::png("this is a qrcode");
$content = "this is a qrcode"; //内容
$filename = time() . ".png"; //文件名
$level = QR_ECLEVEL_L; //容错级别
$size = 10; //尺寸
$padding = 3; //边距
//第二种(自定义下在网页中生成二维码)
QRcode::png($content, false, $level, $size, $padding, true);
//第三种(自定义下将生成的二维码保存为图片文件)
QRcode::png($content, $filename, $level, $size, $padding, true);
/*容错级别
QR_ECLEVEL_L 为常量 0 约可纠错7%的数据码字
QR_ECLEVEL_M 为常量 1 约可纠错15%的数据码字
QR_ECLEVEL_Q 为常量 2 约可纠错25%的数据码字
QR_ECLEVEL_H 为常量 3 约可纠错30%的数据码字
*/
?>
成都创新互联公司主要从事成都网站设计、网站制作、外贸营销网站建设、网页设计、企业做网站、公司建网站等业务。立足成都服务珠晖,10多年网站建设经验,价格优惠、服务专业,欢迎来电咨询建站服务:18982081108