Sen descrición

smiley c55c64dfa0 :book: hai 1 mes
.github 5536c26155 :sparkles: hai 1 mes
.idea d65911ada9 :octocat: dependency update & phpstan happy hai 6 meses
.phan 2f404ba8ee :octocat: hai 5 meses
.phpdoc 22869ae8e2 :book: hai 1 ano
benchmark 8237857cc3 :shower: move and exclude test traits hai 1 mes
docs c55c64dfa0 :book: hai 1 mes
examples d0462ee466 :octocat: allow invocation with options iterable for the public facing classes hai 1 mes
src 53e2d8f7fc :shower: hai 1 mes
tests 490cc43b47 :bath: too many static calls in here hai 1 mes
.editorconfig 826f9cfa65 :octocat: %!s(int64=2) %!d(string=hai) anos
.gitattributes 21b47ffcfb :octocat: hai 1 mes
.gitignore 21b47ffcfb :octocat: hai 1 mes
.readthedocs.yml 6a44b067ef :sparkles: fuck it, read the docs %!s(int64=2) %!d(string=hai) anos
LICENSE-ASL-2.0 66c0b69ffb :octocat: added Apache-2.0 license %!s(int64=3) %!d(string=hai) anos
LICENSE-MIT 66c0b69ffb :octocat: added Apache-2.0 license %!s(int64=3) %!d(string=hai) anos
NOTICE ff147426a1 :octocat: moved some files %!s(int64=2) %!d(string=hai) anos
README.md c55c64dfa0 :book: hai 1 mes
composer.json 039a54a6ad :fire: does this...? hai 1 mes
phpbench.json f31eff72f5 :sparkles: add PHPBench to run benchmarks hai 1 ano
phpcs.xml.dist d65911ada9 :octocat: dependency update & phpstan happy hai 6 meses
phpdoc.xml.dist 61bf95856a :octocat: %!s(int64=2) %!d(string=hai) anos
phpmd.xml.dist 10ed887663 :octocat: +phpmd command hai 1 ano
phpstan-baseline.neon 490cc43b47 :bath: too many static calls in here hai 1 mes
phpstan.dist.neon e6b1ff0ada :octocat: run phpstan on the benchmarks hai 1 ano
phpunit.xml.dist 8237857cc3 :shower: move and exclude test traits hai 1 mes

README.md

chillerlan/php-qrcode

A PHP QR Code generator based on the implementation by Kazuhiko Arase, namespaced, cleaned up, improved and other stuff.
It also features a QR Code reader based on a PHP port of the ZXing library.

Attention: there is now also a javascript port on NPM: @chillerlan/qrcode.

PHP Version Support Packagist version Continuous Integration CodeCov Codacy Packagist downloads Documentation

Overview

Features

  • Creation of Model 2 QR Codes, Version 1 to 40
  • ECC Levels L/M/Q/H supported
  • Mixed mode support (encoding modes can be combined within a QR symbol). Supported modes:
  • Flexible, easily extensible output modules, built-in support for the following output formats:
  • QR Code reader (via GD and ImageMagick)

Requirements

For the QR Code reader, either ext-gd or ext-imagick is required!

Documentation

Important: Please use the examples from the branch that matches your installed php-qrcode version ( v4.x, v5.x, dev-main )!
The main (default) branch is the active development for future major versions, and it is most likely incompatible with the latest release versions.

Installation with composer

See the installation guide for more info!

Terminal

composer require chillerlan/php-qrcode

composer.json

{
	"require": {
		"php": "^8.2",
		"chillerlan/php-qrcode": "dev-main#<commit_hash>"
	}
}

Note: replace dev-main with a version constraint, e.g. ^5.0 - see releases for valid versions.

Quickstart

We want to encode this URI for a mobile authenticator into a QRcode image:

$data = 'otpauth://totp/test?secret=B3JX4VCVJDVNXNZ5&issuer=chillerlan.net';

// quick and simple:
echo '<img src="'.(new QRCode)->render($data).'" alt="QR Code" />';

Wait, what was that? Please again, slower! See Advanced usage in the manual. Also, have a look in the examples folder for some more usage examples.

QR codes are awesome!

Disclaimer!

I don't take responsibility for molten CPUs, misled applications, failed log-ins etc.. Use at your own risk!

License notice

Trademark Notice

The word "QR Code" is a registered trademark of DENSO WAVE INCORPORATED
https://www.qrcode.com/en/faq.html#patentH2Title