復制代碼 代碼如下:
$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 圖片外圍的白色邊框像素
*/
新聞熱點
疑難解答