php生成二唯条码的方法

来源:互联网 发布:淘宝服装代销网站 编辑:程序博客网 时间:2024/06/11 18:34

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://blog.163.com/litianyichuanqi@126/blog/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.'"/>';
}

 目前php生成二维码可以有以下几种方式 - 李宝才 - 李宝才的博客

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
来自: http://hi.baidu.com/%D2%BB%CE%C4%CC%EC/blog/item/794a1833410bbe55ac4b5fc6.html