Recently, I had a project to scan the QR code to get the vcard. I encountered a problem. some of the generated QR codes were garbled in the Chinese names in the vcard obtained after scanning with the android mobile phone, after comparison, we found that the ORG type in this part of vcard is not... recently, I had a project to scan the QR code to get the vcard. I encountered a problem. some of the generated QR codes were garbled in the Chinese names in the vcard obtained after scanning with the android mobile phone, after comparison, we found that there is no content in the ORG type in this part of vcard, and a fixed string is added when no content is determined, so that the garbled problem can be solved.
Php QR code generation methods
1. open the api on google with the following code:
$urlToEncode="http://gz.altmi.com"; generateQRfromGoogle($urlToEncode); function generateQRfromGoogle($chl,$widhtHeight ='150',$EC_level='L',$margin='0') { $url = urlencode($url); echo ''; }
2. php QR Code Library
Address: http://phpqrcode.sourceforge.net/
Download: http://sourceforge.net/projects/phpqrcode/
The code is as follows:
# Create a QR code file
QRcode: png ('code data text', 'filename.png ');
# Generating images to the browser
QRcode: png ('Some othertext 1234 ');
3. libqrencode
Address: http://fukuchi.org/works/qrencode/index.en.html
4. QRcode Perl CGI & PHP scripts
Address: http://www.swetake.com/qr/qr_cgi.html
4. add a logo in the middle of the QR code in the 2nd methods and modify the png method in the QRimage class in phpqrcode. php. the code is as follows:
Permanent link:
Reprint at will! Include the article address.