天天看點

php生成二維碼

1.google開放api

$urlToEncode=”http://bbs.lewanchina.com“;

generateQRfromGoogle($urlToEncode);

function generateQRfromGoogle($chl,$widhtHeight =’150′,$EC_level=’L',$margin=’0′)

{

$url = urlencode($url);

echo ‘<img src=”http://chart.apis.google.com/chart?chs=’.$widhtHeight.’x’.$widhtHeight.’&cht=qr&chld=’.$EC_level.’|’.$margin.’&chl=’.$chl.’” alt=”QR code” widhtHeight=”‘.$size.’” widhtHeight=”‘.$size.’”/>’;

}

2.php類庫PHP QR Code

PHP QR Code is open source (LGPL) library for generating QR Code,

2-dimensional barcode. Based on libqrencode C library,

provides API for creating QR Code barcode images (PNG, JPEG thanks to GD2).

Implemented purely in PHP, with no external dependencies (except GD2 if needed).

位址:http://phpqrcode.sourceforge.net/

下載下傳:http://sourceforge.net/projects/phpqrcode/

3.libqrencode

位址:http://fukuchi.org/works/qrencode/index.en.html

php支援請參考:http://hirokawa.netflowers.jp/entry/4900/

4.QRcode Perl CGI & PHP scripts

位址:http://www.swetake.com/qr/qr_cgi.html

php