Get the App
SLTechnology News&Howtos  ›  Development  › 

How to generate QR Code for thinkphp5

Shulou Source: shulou.com Published: 2022-06-03 17:44:16 11月13日 Update

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!

Tags: Generate 2D QR code articles content pictures not much size most more knowledge level industry information information channels channels fault tolerance reference learning help Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information macOS Docker MySQL MariaDB