复制代码 代码如下:
 
$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.'" widhtHeight="'.$size.'" widhtHeight="'.$size.'"/>'; 
} 
复制代码 代码如下:
 
<? 
include "./phpqrcode/phpqrcode.php"; 
$value="http://www.weste.net"; 
$errorCorrectionLevel = "L"; 
$matrixPointSize = "4"; 
QRcode::png($value, false, $errorCorrectionLevel, $matrixPointSize); 
exit; 
?> 
复制代码 代码如下:
 
include "qrlib.php"; 
QRcode::png($data, $filename, $errorCorrectionLevel, $matrixPointSize, $margin); 
/* 
$data 数据 
$filename 保存的图片名称 
$errorCorrectionLevel 错误处理级别 
$matrixPointSize 每个黑点的像素 
$margin 图片外围的白色边框像素 
*/ 
新闻热点
疑难解答