PHP generated two-dimensional code image method summary

Source: Internet
Author: User
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);?>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.