Use the phpqrcode library to generate a QR code:
1/* 2 * add 3 */4 ///////////////////////////// //// // 5/* introduce file */6 @ include (APP_DIR. '/include/lib/weixin/phpqrcode. php '); 7/* Default storage path */8 $ save_path = PUBLIC_DIR. '/weixin/'; // storage address 9 if (! File_exists ($ save_path) {10 mkdir ($ save_path); 11} 12 $ path = inclusave_path.20.deptid.'.png '; 13 $ path = strstr ($ path ,'/'); 14 $ errorCorrectionLevel = "H"; 15 $ matrixPointSize = "4"; 16 if (! File_exists ($ path) {17 $ c = 'www .baidu.com '; 18 QRcode: png ($ c, inclusave_path.20.deptid.'.png', $ errorCorrectionLevel, $ matrixPointSize ); 19} 20 $ this-> pagedata ['IMG '] = kernel: base_url (1 ). '/weixin/'.20.deptid.'.png '; 21 ///////////////////////////////////////
Use the google interface to generate a QR code:
1/* 2 * generate a QR code and call the google interface 3 * @ var array $ params 4 * @ access public 5 * @ return string 6 */7 function generateQRfromGoogle ($ data, $ widhtHeight = '000000', $ EC_level = 'h', $ margin = '0') {8 9 $ url = urlencode ($ data ); 10 11 return ''; 12 13} // End Function
Another method is to call the jquery. qrcode. js library to generate a QR code: the specific instance will not be written.
Ecstore QR code generation