function qrcode_create($url = 'http://www.baidu.com', $size = '6', $errorlevel = '3')
{
\think\Loader::import('qrcode.phpqrcode');
$qrcode = new \QRcode();
$errorCorrectionLevel = intval($errorlevel);//容错级别
$matrixPointSize = intval($size);//生成图片大小
ob_end_clean();
return $qrcode->png($url, false, $errorCorrectionLevel, $matrixPointSize, 2);
}视图中<img src="{:qrcode_create()}">这样输出的二维码图片是乱码的。怎么回事,但是在控制器中调用这个函数生成的二维码有不乱码控制器中
qrcode_create(); 最佳答案