利用php类库phpqrcode来实现
首先下载类库包
保存到文件
首先下载类库包
直接浏览器输出
<?php
include "phpqrcode.php";
$value="http://www.test.com";
$errorCorrectionLevel = "L";
$matrixPointSize = "4";
QRcode::png($value, false, $errorCorrectionLevel, $matrixPointSize);
exit;
?>
保存到文件
<?php
include('phpqrcode.php');
$value = 'http://www.test.con'; //二维码链接
$filename = 'test.png'; //二维码图片文件名
$errorCorrectionLevel = 'L'; // 纠错级别:L、M、Q、H
$matrixPointSize = 4;
QRcode::png($value, $filename, $errorCorrectionLevel, $matrixPointSize, 2);
?>