worksection / qrcode
此包的最新版本(1.0.1)没有提供许可证信息。
QRCode类(从https://github.com/psyon/php-qrcode代码制作的可用的包)
1.0.1
2021-07-08 18:51 UTC
Requires
- php: >=7.0.0
This package is not auto-updated.
Last update: 2024-09-25 17:57:31 UTC
README
生成二维码。MIT许可证。
从PHP脚本中使用
include 'qrcode.php';
$generator = new QRCode($data, $options);
/* Output directly to standard output. */
$generator->output_image();
/* Create bitmap image. */
$image = $generator->render_image();
imagepng($image);
imagedestroy($image);
使用GET或POST
qrcode.php?s={symbology}&d={data}&{options}
例如:
qrcode.php?s=qr&d=HELLO%20WORLD&sf=8&ms=r&md=0.8
选项
s - 符号(二维码类型)。以下是其中之一:
qr
qr-l
qr-m
qr-q
qr-h
d - 数据。在汉字模式下使用Shift-JIS进行编码。
w - 图像宽度。覆盖sf或sx。
h - 图像高度。覆盖sf或sy。
sf - 缩放因子。默认为4。
sx - 水平缩放因子。覆盖sf。
sy - 垂直缩放因子。覆盖sf。
p - 填充。默认为0。
pv - 顶部和底部填充。默认为p的值。
ph - 左右填充。默认为p的值。
pt - 顶部填充。默认为pv的值。
pl - 左填充。默认为ph的值。
pr - 右填充。默认为ph的值。
pb - 底部填充。默认为pv的值。
bc - 以#RRGGBB格式表示的背景颜色。
fc - 以#RRGGBB格式表示的前景颜色。
md - 模块密度。介于0和1之间的数字。默认为1。
wq - 静区单元的宽度。默认为1。使用0来抑制静区。
wm - 窄模块和空间的宽度。默认为1。