Home >Backend Development >PHP Tutorial >PHP generates QR code image with LOGO_PHP tutorial
Nowadays, QR codes are commonly used in some of our software sites or download sites. In particular, WeChat uses QR codes to add friends. Now I will introduce various methods of using PHP to generate QR codes.
Method 1 This kind of generation is a QR code without a picture in the middle. It can be realized by directly calling a function of Google.
The code is as follows
|
Copy code |
||||||||
$urlToEncode="http://gz.altmi.com";
function generateQRfromGoogle($chl,$widhtHeight ='150',$EC_level= 'L',$margin='0') echo '
$size = isset($_GET['size']) ? $_GET['size'] : '130x130';$logo = isset($ _GET['logo']) ? $_GET['logo'] : './20130128160755.jpg';//The logo picture in the middle $from_width = ($QR_width-$logo_qr_width)/2; imagecopyresampled($QR, $logo, $from_width, $from_width, 0, 0, $logo_qr_width, $logo_qr_height, $logo_width, $logo_height);} header('Content-type: image/png'); imagepng($QR);imagedestroy($ QR); Finally share the download address of some commonly used QR code generation plug-ins Address: http://phpqrcode.sourceforge.net /Download: http://sourceforge.net/projects/phpqrcode/3.libqrencodeAddress: http://fukuchi.org/works/qrencode/index.en .htmlPHP support please refer to: http://hirokawa.netflowers.jp/entry/4900/4.QRcode Perl CGI & PHP scriptsAddress: http://www.swetake .com/qr/qr_cgi.html
http://www.bkjia.com/PHPjc/444625.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/444625.htmlTechArticleNow QR code is a commonly used thing in some of our software sites or download sites, especially WeChat. Use QR code to add friends. Below I will introduce various methods to generate QR code using php...
|