How to generate QR Code for thinkphp5
Editor to share with you how to generate thinkphp5 QR code, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
Vendor ("phpqrcode.phpqrcode"); $url=' http://www.dc3688.com/mobile/User/qrurl/?userid='."$this->user_id"; $level=3; $size=4; $errorCorrectionLevel = intval ($level); / / Fault tolerance level $matrixPointSize = intval ($size); / / generate picture size $path = "public/upload/qrcode/" If (! file_exists ($path)) {mkdir ($path, 0700);} $username=$this- > user_id; $fileName = $path.$username.'.png'; / / generate a QR code picture / / echo $_ SERVER ['REQUEST_URI']; $object = new\ QRcode () $object- > png ($url, $fileName, $errorCorrectionLevel, $matrixPointSize, 2); $result ['qcode'] = $fileName; are all the contents of the article "how does thinkphp5 generate QR Code"? thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!