Download the PHP package tekintian/php_qrcode_tiny without Composer
On this page you can find all versions of the php package tekintian/php_qrcode_tiny. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download tekintian/php_qrcode_tiny
More information about tekintian/php_qrcode_tiny
Files in tekintian/php_qrcode_tiny
Download tekintian/php_qrcode_tiny
More information about tekintian/php_qrcode_tiny
Files in tekintian/php_qrcode_tiny
Vendor tekintian
Package php_qrcode_tiny
Short Description PHP qrcode 二维码工具类 精简版本
License BSD-3-Clause
Homepage https://github.com/tekintian/php_qrcode_tiny
Package php_qrcode_tiny
Short Description PHP qrcode 二维码工具类 精简版本
License BSD-3-Clause
Homepage https://github.com/tekintian/php_qrcode_tiny
Please rate this library. Is it a good library?
Informations about the package php_qrcode_tiny
php qrcode tiny 二维码生成精简版
php生成带LOGO的二维码图片,支持png, jpg格式, 单文件轻巧版!
使用方法
# 切换至项目根目录后执行以下命令安装本工具
composer require "tekintian/php_qrcode_tiny"
生成二维码
# autoload.php自动载入
require_once __DIR__ . 'vendor/autoload.php';
$qr_data = 'http://dev.yunnan.ws'; //二维码数据
$qr_name = 'myqr.png';
$qr_error_correction_level = 'L'; //纠错级别:L、M、Q、H
$qr_matrix_point_size = 10; //二维码矩阵点大小,单位:点, 1到10 数值越大生成的图片就越大
# 使用方法一
\tekintian\QRcodeTiny::png($qr_data, $qr_name, $qr_error_correction_level, $qr_matrix_point_size, 2);
# 使用方法二
\tekintian\qrcode_tiny\Qrcode::png($qr_data, $qr_name, $qr_error_correction_level, $qr_matrix_point_size, 2);
# 生成带LOGO的二维码图片demo
# autoload.php自动载入
require_once __DIR__ . 'vendor/autoload.php';
$data = 'http://dev.yunnan.ws'; //二维码数据
$qr_error_correction_level = 'L'; //纠错级别:L、M、Q、H
$qr_matrix_point_size = 10; //二维码图片的大小,单位:点, 1到10
\tekintian\qrcode_tiny\Qrcode::png($data, 'myqr.png', $qr_error_correction_level, $qr_matrix_point_size, 2); //不带Logo二维码的文件名
//echo "二维码已生成" . "<br />";
$logo = 'logo.png'; //需要显示在二维码中的Logo图像
$QR = 'myqr.png';
if ($logo !== false) {
$QR = imagecreatefromstring(file_get_contents($QR));
$logo = imagecreatefromstring(file_get_contents($logo));
$QR_width = imagesx($QR);
$QR_height = imagesy($QR);
$logo_width = imagesx($logo);
$logo_height = imagesy($logo);
$logo_qr_width = $QR_width / 5;
$scale = $logo_width / $logo_qr_width;
$logo_qr_height = $logo_height / $scale;
$from_width = ($QR_width - $logo_qr_width) / 2;
imagecopyresampled($QR, $logo, $from_width, $from_width, 0, 0, $logo_qr_width, $logo_qr_height, $logo_width, $logo_height);
}
//imagepng ( $QR, 'qr/qr.png' );//带Logo二维码的文件名
// 输出图像到浏览器
header('Content-Type: image/png');
imagepng ( $QR, 'qr/qr.png' ); //输出带Logo二维码图片到浏览器, More: https://www.php.net/manual/zh/function.imagepng.php
exit();
//qr end
All versions of php_qrcode_tiny with dependencies
PHP Build Version
Package Version
Requires
php Version
^5.3|^7.0
The package tekintian/php_qrcode_tiny contains the following files
Loading the files please wait ....