//前期准备:
//1.phpqrcode类文件下载,下载地址:https://sourceforge.net/projects/phpqrcode/
//2.PHP环境必须开启支持GD2扩展库支持(一般情况下都是开启状态)
use think\Loader;
function phpqrcode(){
$url='http://cw.XXXXXXXXX.com/admin/agreement/fast/uid/';
Loader::import('phpqrcode/phpqrcode', EXTEND_PATH);
$value = $url; //二维码内容
$errorCorrectionLevel = 'L'; //容错级别
$matrixPointSize = 5; //生成图片大小
//生成二维码图片
//$filename = ROOT_PATH .'publication'.'/upload/'.'ceshi.png';
$filename = ROOT_PATH .'publication'.'/upload/'.time().'.png';
$objPHPExcel=new \QRcode();
$b = \QRcode::png($value,$filename , $errorCorrectionLevel, $matrixPointSize, 2);
$QR = $filename; //已经生成的原始二维码图片文件
//图片地址
$erweima ='http://cw.hangso123.com/upload/'. time().'.png';
//print_r($erweima);
}
06-07
476
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
08-09
955
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
12-19
12-18