A lot of online tutorials, but I did not introduce success, probably because to embed in the THINKPHP5, but still find a pro test available.
Baidu Cloud: Https://pan.baidu.com/s/1c2bapfM Password: lu5y
First of all:
Introduce files into your project
use Phpqrcode\qrcode;
////Generate two-dimensional code protected functionQRCode () {Loader:: Import ("Phpqrcode.phpqrcode",Extend_path); $value= "https://www.baidu.com/";//Two-dimensional code content $errorCorrectionLevel= ' L ';//Fault tolerance level $matrixPointSize= 5;//Generate picture size//Generate two-dimensional code picture Loader::import ("Phpqrcode.phpqrcode", Extend_path); $value= "https://www.baidu.com/";//Two-dimensional code content $errorCorrectionLevel= ' L ';//Fault tolerance level $matrixPointSize= 5;//Generate picture size//Generate two-dimensional code picture $filename= Root_path. ' Public '. Ds. ' uploads/'. Time().‘. png; QRCode::p ng ($value,$filename,$errorCorrectionLevel,$matrixPointSize, 2); $QR=$filename;//original two-dimensional code image file that has been generated return $QR; }
All that is left is to call it directly. He generated a picture in PNG format.
If you want to save him to the database. You can save it locally or in the cloud first. Then get the link and then save the database.
Above
PHP generates two-dimensional code