PHP uses php qr Code to generate a QR Code
1. QR code
A QR code, also known as a two-dimensional barcode, records the data symbol information with a black-and-white image that is distributed on a plane (two-dimensional direction) according to a certain law, the concept of "0" and "1" bit streams that constitute the internal logic of computers is cleverly used in code compilation, A number of ry corresponding to the binary are used to represent the numerical value of the text. The input device of the image or the photoelectric scanning device can automatically read and read the text for automatic information processing. It has some commonalities of bar code technology: each code system has its specific character set, each character occupies a certain width, and has a certain verification function. At the same time, it also has the ability to automatically identify different rows of information, and to handle graphics rotation changes and other features.
2. php qr Code and case address
3. Simple php qr Code implementation case and parameter description
Case study:
QRcode: png ($ data, $ filename, $ errorCorrectionLevel, $ matrixPointSize, $ margin );
[1] php qr Code supports png, jpg, svg, text, and other formats, starting with QRcode: svg.
[2] $ data: indicates the data to be recorded. A maximum of 984 UTF-8 encoded Chinese characters can be stored.
[3] $ filename: name of the saved Image
[4] $ errorCorrectionLevel: Error Correction level (L, M, Q, H). The QR code has the fault tolerance function. When a QR code image is blocked, it can still be scanned. The higher the blocking rate, the more parts that can be blocked by the QR code image.
[5] $ matrixPointSize: pixels of each black spot
[6] $ margin: The white border pixel outside the image
5. Common QR code data formats
We only need to modify $ data to achieve the desired effect.
URL)
Contains the URL of the QR code generated is the most common access to the ordinary people (such as: http://www.ceshi.com), the QR code identification software through http: // prefix to know the data represents a web site. Using a syntax similar to {URLTO: www.ceshi.com} allows the recognition software to recognize the website.
Email Address)
On the Internet, you will basically use e-mails for contact. Of course, the QR code can also save the e-mail address (such as zhaoxiaobo987@163.com ). Its Syntax format is {mailto: zhaoxiaobo987@163.com }.
Telephone numbers)
The data format generated by the QR code of the phone number is very simple and easy to understand: {tel: 13161555555 }. If it is fixed, add the area code. If you need to contact a friend outside China, add the country code of + 86.
Contact information)
There are many criteria for the contact data format represented by QR code generation. For example, vcard ). However, its format is a little complicated for the QR code. As far as I know, Android phones (such as Apple and Blackberry) on the market generally support the MECARD data format developed by docomo in Japan.
MECARD: N: zhaoxiaobo; ADR: beijing, china; TEL: + 8613161555555; EMAIL: zhaoxiaobo987@163.com; URL: http://blog.csdn.net/zhao1234567890123456/425qq:275620501;
BIZCARD
This data format is similar to that of MECARD, and no specific definition has been found. It seems easier than MECARD; it can only be inspired by the examples.
BIZCARD: N: zhaoxiaobo; T: Software Engineer; C: Google; A: beijing, China; B: + 8613161555555; E: zhaoxiaobo987@163.com;
SMS)
Syntax format: {smsto: 8613161555555: Hello, QR code text message}
MMS)
The text message format is similar to {mmsto: 8613161555555: Content}
Geographic information)
Sharing your current location with friends is undoubtedly a useful feature. For example, google's location in New York is: north latitude 40.71872, west longitude 73.98905, and Height 100. Syntax format: {geo: 40.71872,-73.98905, 100}
Obtain Android software
The QR code can also be used to find software in google's Android Market. 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' indicates no authentication required), S (SSID of the wireless network), and P (password of the wireless network. Skip this option if no authentication is required), H (optional. For networks with hidden SSID ).
5. Generate a QR Code with LOGO in php qr Code