亂碼場景
解決方案
執行生成二維碼的那句代碼後die
或exit
一下就可以了:
public function index()
{
Vendor('phpqrcode.phpqrcode');
$url="https://www.wangchuangcode.cn";
$errorCorrectionLevel =intval(2) ;//容錯級別
$matrixPointSize = intval(4);//生成圖片大小
//生成二維碼圖片
$object = new \QRcode();
$object->png($url, false, $errorCorrectionLevel, $matrixPointSize, 2);
die;
}