Since ios and Android quickly occupied the market, the QR code has been quickly filled up. Similarly, while we are using php for php development, we must first think of the issue of generating the QR code, so where is a good start?
Since ios and Android quickly occupied the market, the QR code has been quickly filled up. Similarly, while we are using php for php development, we must first think of the issue of generating the QR code, so where is a good start?
What should I do? in fact, Google has opened the corresponding api
Don't believe you can try http://chart.apis.google.com/chart? Cht = qr & chs = 100x100 & chlorophyll = phpslight
Http://chart.apis.google.com/chart? : Call the Google Chart API
- Cht = qr
This is required. tell the API that you need to generate a QR code.
- Chs = X
This is also necessary to inform the API of the size of the QR code you need to generate.
- Chlorophyll =
This is required to tell the information contained in the api qr code. It can be numbers, character numbers, characters, binary information, and Chinese characters. The data type cannot be mixed. Data must go through the UTF-8 URL-encoded. If the information to be transmitted exceeds 2 K bytes, use the POST method.
- Choe =
Finally come a not necessary, this is used to declare the generated QR code contains information encoding, the default is UTF-8; other optional encoding is Shift_JIS, ISO-8859-1
- Chld = |
Optional error correction level. QR codes support four levels of error correction to restore lost, read-wrong, fuzzy, and data. The following are optional values: L-(default) can identify data with 7% loss; M-can identify data with 15% loss; Q-can identify data with 25% loss; h-identifies 30% of data loss. Margin refers to the distance between the generated QR code and the image border.
The QR code is square and has the same length and width. The QR code is fixed in size: the length/width from 21 to 177, increasing by 4 pixels each time. Each configuration is called a level. The larger the length and width, the more information is stored. Below is the version summary:
- The QR code with a level of 1 is 21 pixels in length and width. up to 25 letters, numbers, and characters can be stored.
- The QR code with a level of 2 is 25 pixels in length and width. a maximum of 47 letters, numbers, and characters can be stored.
- ... And so on.
The Chart API determines the level of QR code to use based on the size of the information you store. The best QR code reader can read information stored in a QR code of 40. Generally, however, mobile devices can read a maximum of 4 QR codes.