thinkphp3.2

把phpqrcode文件夹放在ThinkPHP\Library\Vendor\下面

phpqrcode下载:

https://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); 
}

 

相关文章:

  • 2022-12-23
  • 2021-11-21
  • 2022-12-23
  • 2021-11-11
  • 2021-12-09
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-02
  • 2022-12-23
  • 2022-01-07
相关资源
相似解决方案