khalilleo-webagentur/php-qrcode
最新稳定版本:v1.0.0
Composer 安装命令:
composer require khalilleo-webagentur/php-qrcode
包简介
PHP library for QR-Code generation
README 文档
README
PHP library for QR Code Generator.
Requirements
- PHP
^8.1
Installation
composer require khalilleo-webagentur/php-qrcode
Usage
// sample HTML <?php require 'vendor/autoload.php'; use Khalilleo\QrCode\QrCode; use Khalilleo\QrCode\QrHelper; $qr = new QRCode(); // QrHelper::QR_ERROR_CORRECT_LEVEL_L (7%) // QrHelper::QR_ERROR_CORRECT_LEVEL_M : (15%) // QrHelper::QR_ERROR_CORRECT_LEVEL_Q : (25%) // QrHelper::QR_ERROR_CORRECT_LEVEL_H : (30%) $qr->setErrorCorrectLevel(QrHelper::QR_ERROR_CORRECT_LEVEL_L); $qr->setTypeNumber(4); $anyString = "https://www.khalilleo.com"; $qr->addData($anyString); $qr->make(); $qr->printHTML(); echo "<br><br>"; $qr = QrCode::getMinimumQRCode($anyString, QrHelper::QR_ERROR_CORRECT_LEVEL_L); $qr->printHTML();
// sample image <?php use Khalilleo\QrCode\QrCode; use Khalilleo\QrCode\QrHelper; require 'vendor/autoload.php'; $qr = QrCode::getMinimumQRCode("https://www.khalilleo.com", QrHelper::QR_ERROR_CORRECT_LEVEL_L); $im = $qr->createImage(2, 4); header("Content-type: image/gif"); imagegif($im); imagedestroy($im);
<?php // sample XML require 'vendor/autoload.php'; use Khalilleo\QrCode\QrCode; use Khalilleo\QrCode\QrHelper; $qr = QrCode::getMinimumQRCode("https://www.khalilleo.com", QrHelper::QR_ERROR_CORRECT_LEVEL_L); header("Content-type: text/xml"); print("<qrcode>"); for ($r = 0; $r < $qr->getModuleCount(); $r++) { print("<line>"); for ($c = 0; $c < $qr->getModuleCount(); $c++) { print($qr->isDark($r, $c)? "1" : "0"); } print("</line>"); } print("</qrcode>");
Credit
Copyright
This project is licensed under the MIT License.
统计信息
- 总下载量: 24
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-04-19