Home  >  Article  >  Backend Development  >  The QR code generated by php displays garbled characters

The QR code generated by php displays garbled characters

王林
王林Original
2019-09-20 11:54:042003browse

The QR code generated by php displays garbled characters

Garbled code scenario

The QR code generated by php displays garbled charactersSolution

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;
    }

The QR code generated by php displays garbled characters

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn