1.載入phpqrcode,並使用合成圖片php
include('phpqrcode.php"); $filename = "xxx.png";//圖片路徑 $errorCorrectionLevel = 'L';//容錯級別 $matrixPointSize = 3; //生成圖大小 $url = 'http://idiot6.com'; QRcode::png($url, $filename, $errorCorrectionLevel, $matrixPointSize, 2); $QR = "xxx.png"; // qr $logo = 'layout-bg-1.png';// bg $QR = imagecreatefromstring ( file_get_contents ( $QR ) ); //open picture source $logo = imagecreatefromstring ( file_get_contents ( $logo ) ); //open picture source imagecopyresampled ( $logo, $QR,565,215,0,0,154,154,$QR_width, $QR_height ); // mixed picture $result_png = rand(100000, 999999) . uniqid() . ".png"; // file name $file = '/data/www/upload/qrcode/' . $result_png; imagepng ( $logo, $file );//output picture
2.qrcode downloadurl