Home>Article>Backend Development> The QR code generated by php displays garbled characters
Garbled code scenario
Solution
Execute the one that generates the QR code Just die or exit after the code:
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; }
Recommended tutorial:PHP video tutorial
The above is the detailed content of The QR code generated by php displays garbled characters. For more information, please follow other related articles on the PHP Chinese website!