The first method:
1, the first method: the use of the most widely used, the most convenient Google API technology implementation;
2
, <?php//package generates two-dimensional code image of the function (method)/* Using the Google API to generate two-dimensional code image $content: QR code content Parameters $size: Generate QR code size, width and height of the value $lev: Optional parameters, error correction level $ margin: The resulting QR code distance from the border */function Create_erweima ($content, $size = ' + ', $lev = ' L ', $margin = ' 0 ') {$content = UrlEncode ($co ntent); $image = ' '; return $image;}
/* Use precautions first build content string call function Generate *///build content string $content= "public platform: Thinking and Logic rn public number: Siweiyuluoji";//Call function to generate a two-dimensional code image echo Create_erweima ($ content);//Generate two-dimensional code for the URL, $url = "http://jingyan.baidu.com/article/0964eca23c39ce8285f5363c.html"; $url. = "RN"; $url. = " Http://jingyan.baidu.com/article/03b2f78c4d28ae5ea237ae15.html "; Echo Create_erweima ($url);? >
The second method:
Download the unzip, then copy (or copy) the Phpqrcode folder to the project;
, <?php//introduces core library file include "phpqrcode/phpqrcode.php";//Define error correction Level $errorlevel = "L";//define image width and height; default = 3$size = "4";// Define build content $content= "public platform: thinking and logic; public number: Siweiyuluoji";//Calling static method of QRCode class PNG generates a QR code image//qrcode::p ng ($content, False, $ ErrorLevel, $size);//Generate URL type $url= "http://jingyan.baidu.com/article/48a42057bff0d2a925250464.html"; $url. = "RN"; $ Url.= "http://jingyan.baidu.com/article/acf728fd22fae8f8e510a3d6.html"; $url. = "RN"; $url. = "http:// Jingyan.baidu.com/article/92255446953d53851648f412.html "; QRCode::p ng ($url, False, $errorLevel, $size);?>