Load the Phpqrcode. class file for the vendor directory
$a = Vendor ("Phpqrcode.qrlib");
Create a Directory
echo mkdir (__root__. ' /uploads/qrcodes ');
Generate file name
$filename = __root__. ' /uploads/qrcodes/qrcode-'. MD5 (UID). PNG ';
$errorCorrectionLevel = ' L ';
$matrixPointSize = 4;
$url = ' http://163.com ';
\qrcode::p ng ($url, $filename, $errorCorrectionLevel, $matrixPointSize, 2);
Echo ' ';
----------------------------------------
Baidu App
/* QR code */
Public Function QRCode () {
$wx [' share_url '] = $url = ' http://'. $_server[' Http_host '].__root__. ' /?r_uid= '. UID;
$wx [' url '] = ' http://'. $_server[' Http_host '].__self__;
$ch = Curl_init ();
$url = ' http://apis.baidu.com/3023/qr/qrcode?qr= '. $wx [' Share_url '];
$header = Array (
' APIKEY:E7ACB07121F84142A79795A37F8333B9 ',//Apikey
);
Add Apikey to Header
curl_setopt ($ch, Curlopt_httpheader, $header);
curl_setopt ($ch, Curlopt_returntransfer, 1);
Executing an HTTP request
curl_setopt ($ch, Curlopt_url, $url);
$res = curl_exec ($ch); Send Request
$a = Json_decode ($res);
Var_dump ($a);
Echo ' url. ' " > ';
Var_dump (Json_decode ($res));
// }
PHP Generate Verification Code