- 授权协议: MIT
- 开发语言: PHP
- 操作系统: 跨平台
- 软件首页: https://github.com/WaitMoonMan/qr-code-plus
- 软件文档: https://github.com/WaitMoonMan/qr-code-plus
软件介绍
基于 QR Code 的二维码生成包,可以生成四色, 九色, 十六色, 背景图二维码。
Demo
安装
composer require waitmoonman/qrcodeplus
基本使用
<?php
require 'vendor/autoload.php';
use QrCodePlus\Exception\InvalidException;
use QrCodePlus\QrCodePlus;
$qrcodeplus = new QrCodePlus();
$qrcodeplus->setText('http://blog.shiguopeng.cn');
$qrcodeplus->setSize(500);
try
{
// 设置颜色, 四种或者九种或者十六种
$param = [
'#087',
'#431',
'#a2d',
'#12d',
'#098',
'#182',
'#039',
'#20d',
'#520',
];
// If you want to generate, the picture is the background
// $param = imagecreatefrompng('your.png');
$qrcodeplus->build($param);
}
catch (InvalidException $e)
{
var_dump($e->getMessage());
exit();
}
