Php generates QR code. The QR code generation program can be found on the internet. we have found many plug-ins or APIs for generating QR codes for free are provided on some foreign websites. I will introduce several types of them below. The QR code generation program can be found on the internet. we have found many plug-ins or APIs for generating QR codes for free are provided on some foreign websites. I will introduce several types of them below.
The simplest and most practical open-source goolge method
1. open APIs for google
Example
| The code is as follows: |
|
|
$ UrlToEncode = "http://gz.altmi.com ";
GenerateQRfromGoogle ($ urlToEncode );
Function generateQRfromGoogle ($ chlorophyll, $ widhtHeight = '000000', $ EC_level = 'l', $ margin = '0 ')
{
$ Url = urlencode ($ url );
Echo'
Chs = '. $ widhtHeight. 'X '. $ widhtHeight. '& cht = qr & chld = '. $ EC_level. '| '. $ margin. '& chlorophyll = '. $ chlorophyll. '"alt =" QR code"
WidhtHeight = "'. $ size.'" widhtHeight = "'. $ size.'"/> ';
} |
The above method is simple and fast, just a few words. The disadvantage is that google server is called. if google does not provide services, we cannot
Now, let's look at it again.
2. php QR Code Library
Address: http://phpqrcode.sourceforge.net/
Download: http://sourceforge.net/projects/phpqrcode/
Example
| The code is as follows: |
|
|
Include ('./phpqrcode. php ');
// QR code data
$ Data = 'http: // gz.altmi.com ';
// Generated file name
$ Filename = $ errorCorrectionLevel. '| '.w.matrixpointsize.'.png ';
// Error correction level: L, M, Q, H
$ ErrorCorrectionLevel = 'l ';
// Vertex size: 1 to 10
$ MatrixPointSize = 4;
QRcode: png ($ data, $ filename, $ errorCorrectionLevel, $ matrixPointSize, 2 );
?> |
This is not bad but saved on your own server. Some examples include libqrencode and QRcode Perl CGI & PHP scripts QR code generation plug-ins.
You can also take a look.
....