基于QRCode的二维码生成包,可以生成四色,九色,十六色,背景图二维码。
Demo安装composer require waitmooma/qrcodeplus基本使用<?php require 'vedor/autoload.php'; use QrCodePlus\Exceptio\IvalidExceptio; use QrCodePlus\QrCodePlus; $qrcodeplus = ew QrCodePlus(); $qrcodeplus->setText('https://blog.shiguopeg.c'); $qrcodeplus->setSize(500); try { // 设置颜色, 四种或者九种或者十六种 $param = [ '#087', '#431', '#a2d', '#12d', '#098', '#182', '#039', '#20d', '#520', ]; // If you wat to geerate, the picture is the backgroud // $param = imagecreatefrompg('your.pg'); $qrcodeplus->build($param); } catch (IvalidExceptio $e) { var_dump($e->getMessage()); exit(); }点击空白处退出提示
评论