PHPackages                             tekintian/phpqrcode - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. tekintian/phpqrcode

ActiveLibrary[Image &amp; Media](/categories/media)

tekintian/phpqrcode
===================

支持PHP5.3至php8.2的 qrcode 二维码工具类 改进版本，支持自定义LOGO，自定义输出目录和自定义返回类型 图片，base64图片数据, 二维码图片自定义，静态方法调用，方便快捷，高效，简洁的PHP二维码生成工具

1.1.0(2y ago)98.9k↑928.6%3[1 issues](https://github.com/tekintian/phpqrcode/issues)3BSD-3-ClausePHPPHP ^5.3|^7.0|^8.0

Since Jun 5Pushed 1y ago1 watchersCompare

[ Source](https://github.com/tekintian/phpqrcode)[ Packagist](https://packagist.org/packages/tekintian/phpqrcode)[ Docs](https://github.com/tekintian/phpqrcode)[ RSS](/packages/tekintian-phpqrcode/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (4)Used By (3)

php qrcode 二维码生成工具 base64图片二维码
==============================

[](#php-qrcode-二维码生成工具--base64图片二维码)

php生成带LOGO的二维码图片, 支持自定义LOGO，自定义输出目录和自定义返回类型，静态方法调用，方便快捷，高效，简洁的PHP二维码生成工具

支持二维码直接返回符合 RFC 2045规范 的 base64, b64 二维码, 首创方法！

支持PHP版本： 5.x -- 8.2, 推荐php8中使用

使用方法
----

[](#使用方法)

```
# 切换至项目根目录后执行以下命令安装本工具

composer require tekintian/phpqrcode
```

生成二维码 封装工具类使用方法
---------------

[](#生成二维码-封装工具类使用方法)

- 推荐方式， 只支持png

```
# autoload.php自动载入
require_once __DIR__ . 'vendor/autoload.php';

$str = "http://dev.tekin.cn";
// 直接生成并输出二维码图片，默认大小
// \tekintian\TekinQR::getQRImg($str);

// 返回base64图片流
$qr = \tekintian\TekinQR::getQRImg($str, 10, null, 1);
echo $qr;

// 生成带loog的二维码
// $qr = \tekintian\TekinQR::getQRImg($str, 10, "http://tekin.cn/logo.png", 0);

// 生成二维码并写入到  /var/www/static/qr/123.png
// $qr =\tekintian\TekinQR::getQRImg($str, 10, "http://tekin.cn/logo.png", 2, "/var/www/static/qr/123.png");

// getQRImg(String $str, int $size = 10, String $logo = null, int $ret_type = 0, String $out_file = null)

// 生成二维码并返回二进制二维码图片数据
$img_data = \tekintian\TekinQR::getQRImg($qr_str, 10, null, 3);
// laravel 写入图片数据
// Storage::disk('local')->put('myqrfile.png', $img_data);
// 将二进制图片数据写入到文件
file_put_contents('myqrfile.png', $img_data);
```

phpqrcode原生工具类使用方法
------------------

[](#phpqrcode原生工具类使用方法)

- 官方模式, 可支持png, jpg格式图片

```
# autoload.php自动载入
require_once __DIR__ . '/vendor/autoload.php';

//生成PNG图片
\tekintian\QRcode::png($str, false, 3, 10, 1, 4, 1);
//生成JPG图片
// \tekintian\QRcode::jpg($str, false, 3, 10, 1, 4, 1);
```

更多用法，请参考官方文档

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance27

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~624 days

Total

3

Last Release

970d ago

PHP version history (2 changes)1.0PHP ^5.3|^7.0

1.0.1PHP ^5.3|^7.0|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/798ee906929abfb6fc44fb15400d7f0058dc60ed0b14367a331250f980075da3?d=identicon)[tekintian](/maintainers/tekintian)

---

Top Contributors

[![tekintian](https://avatars.githubusercontent.com/u/10243043?v=4)](https://github.com/tekintian "tekintian (10 commits)")

---

Tags

phpqrcodephpqrcodetiny qrcodephp qrcode with logo

### Embed Badge

![Health badge](/badges/tekintian-phpqrcode/health.svg)

```
[![Health](https://phpackages.com/badges/tekintian-phpqrcode/health.svg)](https://phpackages.com/packages/tekintian-phpqrcode)
```

###  Alternatives

[sybio/gif-creator

PHP class that creates animated GIF from multiple images

330410.1k14](/packages/sybio-gif-creator)[dereuromark/media-embed

A PHP library to deal with all those media services around, parsing their URLs and embedding their audio/video content in websites.

181576.2k17](/packages/dereuromark-media-embed)[robbiep/zbar-qrdecoder

A PHP wrapper for Zbar. Decodes images/photos containing QR codes.

3351.8k](/packages/robbiep-zbar-qrdecoder)[kiwilan/php-audio

PHP package to parse and update audio files metadata, with `JamesHeinrich/getID3`.

3115.0k1](/packages/kiwilan-php-audio)[nikkanetiya/laravel-color-palette

Laravel Wrapper for `ksubileau/color-thief-php`. Grabs the dominant color or a representative color palette from an image. Uses PHP and GD or Imagick.

3312.7k](/packages/nikkanetiya-laravel-color-palette)[automattic/wistia-php

PHP wrapper for Wistia API

1431.9k](/packages/automattic-wistia-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
