thinkphp3.2 把phpqrcode文件夹放在ThinkPHPLibraryVendor下面 phpqrcode下载:
http://files.cnblogs.com/files/qhorse/phpqrcode.rar
在控制器
public function qrcode($url='http://www.baidu.com/',$level=3,$size=5){ Vendor('phpqrcode.phpqrcode'); $errorCorrectionLevel =intval($level) ;//容错级别 $matrixPointSize = intval($size);//生成图片大小 //生成二维码图片 //echo $_SERVER['REQUEST_URI']; $object = new QRcode(); $object->png($url, false, $errorCorrectionLevel, $matrixPointSize, 2); }