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: |
Copy code |
$ 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: |
Copy code |
<? Php 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.