Generally, what QR code APIs are used to generate QR codes for platform distribution? generally, what QR code APIs are used to generate QR codes for platform distribution?
Reply content:
What QR code APIs are generally used to generate a QR code for platform distribution?
For specific use cases, php can use the qrcode third-party library.
Qrcode class library
TP
Vendor ("phpqrcode. phpqrcode"); $ QRcode = new QRcode (); $ data = $ data? $ Data: 'error occurred while generating the QR code. contact the administrator! '; // Error correction level: L, M, Q, H $ level = 'l'; // point size: 1 to 10, $ size = 8 for mobile phone 4; // The following comments the code for saving the QR code image to a local device. if you want to save the image, replace the second parameter with $ fileName: false $ path = ". /Public/Upload/QrcPic/"; if (! Is_dir ($ path) {mkdir ($ path, 0777, true);} // The generated file name $ fileName contains your prefix.inclusid.'.png '; // You can check whether the file exists, the two-dimensional code image name is returned. // $ checkFile = $ path. $ fileName; if (file_exists ($ checkFile) {return $ fileName; exit;} // stream at the output graph // QRCimg = QRcode: png ($ data, $ fileName, $ level, $ size, $ padding); $ QRcode-> png ($ data, $ path. $ fileName, $ level, $ size, $ padding );