PHP qr code generation _php Tutorial

Source: Internet
Author: User

PHP generates two-dimensional code via PHP QR code


1, two-dimensional code

Two-dimensional code, also known as a two-dimensional barcode, it is a certain geometry according to a certain pattern in the plane (two-dimensional direction) distribution of the black and white graphics data symbol information, in the code to skillfully use the composition of the computer's internal logic based on the "0", "1" bit stream concept, A number of geometric shapes corresponding to the binary are used to represent the literal numerical information, which is automatically read by the image input device or photoelectric scanning device to realize automatic information processing. It has some common features of barcode technology: Each code system has its specific character set, each character occupies a certain width, and has certain checking function. At the same time, it also has the features of automatic recognition of different lines, and the processing of the change of graphics rotation.

2. PHP QR code Download address and case address

3, PHP QR code Implementation of a simple case and parameter description

 
  
Case Description:
QRCode::p ng ($data, $filename, $errorCorrectionLevel, $matrixPointSize, $margin);
[1] PHP QR code supports PNG, JPG, SVG, text and other formats, using the same format as Qrcode::svg.
[2] $data: Represents the data to be recorded, if it is stored utf-8 encoded in Chinese, a maximum of 984.
[3] $filename: Saved picture name
[4] $errorCorrectionLevel: Error correction level (L, M, Q, H), two-dimensional code with fault-tolerant function, when the QR code picture is obscured part, can still be scanned out. The higher the fault tolerance, the more parts of the two-dimensional code image can be obscured.
[5] $matrixPointSize: pixels per Black Point
[6] $margin: white border pixels outside the picture

5, two-dimensional code commonly used data format

We only need to modify the $DATA data to achieve the desired effect.
Web address (URL)
Contains the URL of the two-dimensional code generation is the most common contact (for example: http://www.ceshi.com), QR code recognition software can be known by http://prefix to know that the data represents a Web address. Using a syntax format similar to {URLTO:www.ceshi.com} also allows recognition software to recognize URLs.
e-mail (e-mail address)
e-mail will be used on the Internet when you contact us. Of course, the QR code can also hold the address of the e-mail (for example, zhaoxiaobo987@163.com). Its syntax format is {mailto:zhaoxiaobo987@163.com}.

Phone number (telephone numbers)
The data format generated by the QR code of the phone number is simple and easy to understand: {tel:13161555555}. If you have a landline, add a +86 country code to a friend who needs to be contacted overseas.

Contact information (information)
There are a number of criteria for the contact data format to be represented in the form of two-dimensional code generation. For example: vcard (Electronic Business card). However, its format is slightly more complicated for QR codes. At present, as far as I know, the Android phone (Apple, BlackBerry, etc.) in the market generally supports the Mecard data format developed by Japanese DoCoMo company.
Mecard:n:zhaoxiaobo; adr:beijing,china;tel:+8613161555555; email:zhaoxiaobo987@163.com; url:http://blog.csdn.net/zhao1234567890123456/; qq:275620501;

Bizcard
This data format is similar to Mecard, and no specific definition has been found yet. Seems to be simpler than mecard; it can only be inspired by some examples.
Bizcard:n:zhaoxiaobo; T:software Engineer; C:google; A:beijing, China; b:+8613161555555; e:zhaoxiaobo987@163.com;

SMS (SMS)
Syntax format: {smsto:8613161555555: Hello, two-dimensional code texting}

MMS (MMS)
Similar to Text message format: {mmsto:8613161555555: Content}

Location (Geographic information)
Sharing your present position with a friend is undoubtedly a useful feature. For example, see Google's location in New York: North latitude 40.71872, longitude 73.98905, height 100 meters. Syntax format: {geo:40.71872,-73.98905,100}

Get Android software
Looking for software in Google's Android Market, QR codes can also be useful. For example: {Market://details?id=org.example.foo}


Get WiFi configuration (Android)
{WIFI:T:WPA; S:mynetwork; P:mypass}. Parameter T (authentication type: WEP or WPA, ' NoPass ' represents no authentication required), S (SSID of wireless network), P (password for wireless network, ignore if authentication is not required), H (optional). For networks that have a hidden SSID).
5, PHP QR code generation with logo two-dimensional code

 

http://www.bkjia.com/PHPjc/885679.html www.bkjia.com true http://www.bkjia.com/PHPjc/885679.html techarticle php through the PHP QR code to generate two-dimensional code 1, two-dimensional code two-dimensional code, also known as two-dimensional barcode, it is a certain geometry according to a certain pattern in the plane (two-dimensional direction) distribution of black and white ...

  • 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.