PHPackages                             oss\_dog/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. oss\_dog/phpqrcode

ActiveLibrary

oss\_dog/phpqrcode
==================

基于phpqrcode修改的二维码生成工具:可自定义二维码颜色和头像

v1.0(3y ago)01161MITPHPPHP &gt;=5.3

Since Aug 26Pushed 3y agoCompare

[ Source](https://github.com/cosmosjack/phpqrcode)[ Packagist](https://packagist.org/packages/oss_dog/phpqrcode)[ RSS](/packages/oss-dog-phpqrcode/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (2)Used By (0)

文档
==

[](#文档)

> **写在前面**
>
> 1. 安装命令`composer require doing/phpqrcode 版本号` ，例 `composer require doing/phpqrcode 1.*`(如果安装不是最新或者没找到包可能是中国镜像有延迟)
> 2. 此包可以集成任何框架:所以PHP都能集成(本包作者在ThinkPHP5中编写，故在此框架下集成可能会有更好的体验)
> 3. 此包依赖于`phpqrcode`在此感谢为此奉献的作者们
> 4. [packagist地址](https://packagist.org/packages/doing/phpqrcode)
> 5. [github地址](https://github.com/Doing0/phpqrcode)欢迎`Star`

简单调用示例
------

[](#简单调用示例)

> 注：不会自动创建文件夹(存放二维码的)如果文件夹不存在会报错,以下为例就得先创建文件夹uploads

```
//二维码的内容
 $text = "Test";
//二维码导出的储存地址
 $outfile = "uploads/222.png";
//二维码的大小
 $size = 6;
 //调用方法成功后,会在相应文件夹下生成二维码文件
 QRcode::png($text, $outfile, $size);
```

### 上述中 png方法一共7个参数(建议只填$text,$outfile)

[](#上述中-png方法一共7个参数建议只填textoutfile)

> 在传递以下参数时一定注意顺序和默认值

1. $text是二维码的内容;
2. $outfile导出文件的路径和文件名称:后缀一定是png,测试时建议不要路径只要文件名如：2222.png,生成了图片后去盘符搜索此文件在哪个文件夹里面,然后根据此文件的路径设计$outfile的路径。
3. $size图片大小默认是6建议不用传:可根据业务需求调整:数字越大图片越大
4. $color二维码样式:默认是黑色16进制#000,建议不要修改
5. $level是容错率模式是最高:强烈建议不修改
6. $margin=2二维码外面的白边距离越大留白越大,强烈建议不修改
7. $saveandprint是否打印强烈建议不修改

给二维码加头像或者logo
-------------

[](#给二维码加头像或者logo)

```
$QR调用png生成的二维码全路径
$QR = 'D:\phpStudy\WWW\credits\public\uploads\2.png';
$header头像全路径:头像一定是正方形
$header = 'D:\phpStudy\WWW\credits\public\uploads\1.png';
$QR = QRcode::addHeader($header, $QR);
//调用addHeader后,之前的二维码被覆盖,生成合并后二维码,并返回全路径$QR

```

VCARD名片信息二维码
------------

[](#vcard名片信息二维码)

```
$content = 'BEGIN:VCARD' . "\n";
$content .= 'VERSION:2.1' . "\n";
$content .= 'N:张' . "\n";
$content .= 'FN:三' . "\n";
$content .= 'TEL;WORK;VOICE:18780808080' . "\n";
$content .= 'ORG:公司:xxx科技有限公司'. "\n";
$content .= 'END:VCARD' . "\n";
$file = 'zs.png';
//调用方法成功后,会在相应文件夹下生成二维码文件
 QRcode::png($content, $file);

 当扫码此二维码时,点击保存联系人就会把联系人的姓+名 电话 公司信息等保存在联系人里面
 请求参数$content的编写规则可去百度搜索vcard参数

```

###  Health Score

22

—

LowBetter than 25% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 80% 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

Unknown

Total

1

Last Release

1304d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7da2baa14a001e0e14104362bbf9e381afa100584d0bdfb5af82d4cb79ea36c1?d=identicon)[cosmosjack](/maintainers/cosmosjack)

---

Top Contributors

[![Doing0](https://avatars.githubusercontent.com/u/36249980?v=4)](https://github.com/Doing0 "Doing0 (4 commits)")[![cosmosjack](https://avatars.githubusercontent.com/u/15810268?v=4)](https://github.com/cosmosjack "cosmosjack (1 commits)")

---

Tags

phpqrcode

### Embed Badge

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

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

###  Alternatives

[chillerlan/php-qrcode

A QR Code generator and reader with a user-friendly API. PHP 8.2+

2.3k26.8M172](/packages/chillerlan-php-qrcode)

PHPackages © 2026

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