<?php //引入 phpqrcode 类库//phpqrcode下载地址:https://github.com/t0k4rt/phpqrcoderequire_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%的数据码字*/ ?> |
点击查看更多内容
为 TA 点赞
评论
共同学习,写下你的评论
评论加载中...
作者其他优质文章
正在加载中
感谢您的支持,我会继续努力的~
扫码打赏,你说多少就多少
赞赏金额会直接到老师账户
支付方式
打开微信扫一扫,即可进行扫码打赏哦