composer require dh2y/think-qrcode
控制器:
代码语言:javascript复制<?php
declare (strict_types = 1);
namespace appadmincontroller;
use dh2yqrcodeQRcode;
class Index
{
public function index()
{
$code = new QRcode();
$res = $code->png('https://www.baidu.com/',false, 6)->logo('D:/phpstudy_pro/WWW/1.jpg')->entry();
dump($res);
}
}
logo(‘D:/phpstudy_pro/WWW/1.jpg’)->entry()//不设置则二维码没有LOGO图 png(‘https://www.baidu.com/’,false, 6),值越大,质量越大