


The $saveandprint parameter indicates whether to save the QR code and display it. Using the library to create a QR code is straightforward as A-B-C: Load and use the library. The parameter $size indicates the size of the generated image, which is 3 by default the parameter $margin indicates the space between the blank areas around the QR code the area covered can also be identified, which are l (QR green L, 7%), M (QR green L, 15%), Q (QR green L, 25%), H (QR green L, 30%) The parameter $level indicates the fault tolerance rate, i.e. The parameter $outfile indicates whether to output the QR code picture file. The parameter $text means to generate two bit information text Public static function png($text, $outfile=false, $level=QR_ECLEVEL_L, $size=3, $margin=4, $saveandprint=false) I used the CI framework, so I changed the first class name qrstr to qrstr, phpqrcode.php to Qrcode.php, put the file in the application/libraries directory, and then loaded the class $this - > Load - > Library ('Qrcode ') in the CI controller file Phpqrcode.php provides a key png() method Of course, your PHP environment must be enabled to support GD2. The first class name is qrstr, and the file name is phpqrcode.Īfter downloading the class library provided by the official website, you only need to use phpqrcode.php to generate QR code. Open the file and you can see that it consists of multiple classes (I used 1.1.4).
#Php qr code with text download#
(you need to download the phpqrcode class file)
