GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - chillerlan/php-qrcode: A PHP QR Code generator and reader with a user-friendly API.

BranchesTags
Open more actions menu

Latest commit

 

History

1,296 Commits
1,296 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
.idea
.idea
 
 
.phan
.phan
 
 
.phpdoc/template
.phpdoc/template
 
 
benchmark
benchmark
 
 
docs
docs
 
 
examples
examples
 
 
src
src
 
 
tests
tests
 
 
.editorconfig
.editorconfig
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
.readthedocs.yml
.readthedocs.yml
 
 
LICENSE-ASL-2.0
LICENSE-ASL-2.0
 
 
LICENSE-MIT
LICENSE-MIT
 
 
NOTICE
NOTICE
 
 
README.md
README.md
 
 
composer.json
composer.json
 
 
phpbench.json
phpbench.json
 
 
phpcs.xml.dist
phpcs.xml.dist
 
 
phpdoc.xml.dist
phpdoc.xml.dist
 
 
phpmd.xml.dist
phpmd.xml.dist
 
 
phpstan-baseline.neon
phpstan-baseline.neon
 
 
phpstan.dist.neon
phpstan.dist.neon
 
 
phpunit.xml.dist
phpunit.xml.dist
 
 

Repository files navigation

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:
    • numeric
    • alphanumeric
    • 8-bit binary
      • ECI support
    • 13-bit double-byte:
      • kanji (Japanese, Shift-JIS)
      • hanzi (simplified Chinese, GB2312/GB18030) as defined in GBT18284-2000
  • Flexible, easily extensible output modules, built-in support for the following output formats:
    • GdImage (raster graphics: avif, bmp, gif, jpeg, png, webp)
    • ImageMagick (multiple supported image formats)
    • Markup types: SVG, HTML, etc.
    • String types: JSON, plain text, etc.
    • Encapsulated Postscript (EPS)
    • PDF via FPDF
  • QR Code reader (via GD and ImageMagick)

Requirements

  • PHP 8.4+
    • ext-mbstring
    • optional:
      • ext-gd for QRGdImage based output
      • ext-imagick with ImageMagick installed
      • ext-fileinfo required by QRImagick output
      • setasign/fpdf for the PDF output module
      • intervention/image for alternative GD/ImageMagick output

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

Documentation

  • The user manual is at https://php-qrcode.readthedocs.io/ (sources)
  • An API documentation created with phpDocumentor can be found at https://chillerlan.github.io/php-qrcode/
  • The documentation for the QROptions container is here: chillerlan/php-settings-container
  • Benchmark results can be found in the benchmark branch

Important: Please use the examples from the branch that matches your installed php-qrcode version ( v5.x, v6.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.4",
		"chillerlan/php-qrcode": "dev-main#<commit_hash>"
	}
}

Note: replace dev-main with a version constraint, e.g. ^6.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

  • Parts of this code are ported to PHP from the ZXing project and licensed under the Apache License, Version 2.0.
  • The documentation is licensed under the Creative Commons Attribution 4.0 International (CC BY 4.0) License.

Trademark Notice

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

Anti clanker clause

If your issue reports and pull requests are LLM generated, keep them. I'll prefer to keep my bugs then. I don't want anything to do with the water guzzling, air polluting, brain cooking, confidently lying fascist plagiarism machines. Use your human brain and hands instead.

About

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

smiley.codes/qrcode/

Topics

imagemagicklet-php5-diephpphp-libraryphp5-is-deadphp7php7-is-deadphp8phpqrcodeqr-codeqr-generatorqr-readerqrcodeqrcode-generatorqrcode-readerqrcode-scannersvg

Resources

Readme
Activity
Custom properties

Stars

2.4k stars

Watchers

51 watching

Forks

323 forks
Report repository

Releases

Sponsor this project

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.