PHPackages                             primer/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. primer/phpqrcode

ActiveLibrary

primer/phpqrcode
================

A modern implementaion of QR code 2D barcode generator. Pure-php LGPL implementation based on https://phpqrcode.sourceforge.net, itself based on C libqrencode by Kentaro Fukuchi.

1.2.0(today)01↑2900%LGPL-2.1-or-laterPHPPHP &gt;=7.3

Since Aug 1Pushed todayCompare

[ Source](https://github.com/primer97/phpqrcode)[ Packagist](https://packagist.org/packages/primer/phpqrcode)[ Docs](https://github.com/primer97/phpqrcode)[ RSS](/packages/primer-phpqrcode/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (2)Versions (3)Used By (0)

phpqrcode
=========

[](#phpqrcode)

PHP QRCode Generator Library

Dependency : php 7.3 and later.

Installation
------------

[](#installation)

Type on the terminal `composer require primer/phpqrcode`

Or, by adding this entry on the composer.json file

```
{
    "require": {
        "primer/phpqrcode": "~1"
   }
}
```

Usage
-----

[](#usage)

Encode "data" into a png file:

```
QRcode::png("data", "path/to/file.png");
```

[![QR](./tests/out/qr.png)](./tests/out/qr.png)

Options
-------

[](#options)

```
QRcode::png($text, $outfile ,
            correctionLevel: QRConstants::QR_ECLEVEL_L,
            size: 3,
            margin: 4,
            saveandprint: false);
```

### Correction Level

[](#correction-level)

(int) correction level, fom the lowest to highest:

- `QRConstants::QR_ECLEVEL_L` 0
- `QRConstants::QR_ECLEVEL_M` 1
- `QRConstants::QR_ECLEVEL_Q` 2
- `QRConstants::QR_ECLEVEL_H` 3

### Size

[](#size)

(int) Pixel size

### Margin

[](#margin)

(int) Raw silent zone (margin zone = raw \* size)

### Save and Print

[](#save-and-print)

Use saveAndPrint (bool) option to send to the browser both http header and image content.

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance100

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity29

Early-stage or recently created project

 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

Unknown

Total

1

Last Release

0d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ff9f690efa671609f17ad5f29fb883bfa138d7578e617946d0cd6893fc1a2951?d=identicon)[primer97](/maintainers/primer97)

---

Top Contributors

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

---

Tags

qrcodephp-qrcode

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[tecnickcom/tcpdf

Deprecated legacy PDF engine for PHP. Use instead tecnickcom/tc-lib-pdf.

4.5k112.8M607](/packages/tecnickcom-tcpdf)[endroid/qr-code

Endroid QR Code

4.8k76.5M522](/packages/endroid-qr-code)[simplesoftwareio/simple-qrcode

Simple QrCode is a QR code generator made for Laravel.

2.9k31.6M120](/packages/simplesoftwareio-simple-qrcode)[chillerlan/php-qrcode

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

2.4k40.0M313](/packages/chillerlan-php-qrcode)[milon/barcode

Barcode generator like Qr Code, PDF417, C39, C39+, C39E, C39E+, C93, S25, S25+, I25, I25+, C128, C128A, C128B, C128C, 2-Digits UPC-Based Extention, 5-Digits UPC-Based Extention, EAN 8, EAN 13, UPC-A, UPC-E, MSI (Variation of Plessey code)

1.5k14.8M59](/packages/milon-barcode)[pragmarx/google2fa-qrcode

QR Code package for Google2FA

12035.2M57](/packages/pragmarx-google2fa-qrcode)

PHPackages © 2026

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