Ratings | | Unique User Downloads | | Download Rankings |
66% | | Total: 1,182 | | All time: 3,209 This week: 54 |
|
Description | | Author |
This package can generate QR Code images in pure PHP.
The main class can take a given string of data and generates the matrix of QR Code points. The type of QR code and error correction level are configurable parameters.
A separate class can render the generated QR Code and render it as a JPEG image of a given width and height. The generated image is return as a string of JPEG image data.
This package is inspired on Jerome Etienne jQuery plugin. | |
|
|
Innovation award
Nominee: 4x |
|
Recommendations
Example
<?php
/**
* This file is part of the phpQr package
*
* See @see QRCode class for description of package and license.
*/
ini_set('display_errors', 1);
error_reporting(-1);
set_include_path(
get_include_path() .
PATH_SEPARATOR .
'../src'
);
require_once 'QRErrorCorrectLevel.php';
require_once 'QRCode.php';
require_once 'QRCodeImage.php';
try
{
$code = new QRCode(-1, QRErrorCorrectLevel::H);
$code->addData("http://www.phpclasses.org");
$code->make();
$img = new QRCodeImage($code, 256, 256, 10);
$img->draw();
$img->store("test.jpg");
$img->finish();
}
catch (Exception $ex)
{
echo $ex->getMessage() . "\n";
echo $ex->getTraceAsString() . "\n";
}
|
Details
phpQr - A QRCode encoder class
by Maik Greubel (greubel@nkey.de)
The intention to create a basic qrcode encoder for PHP was a request on phpclasses.org.
The author studied multiple sources to get an idea how qrcode implementation works under the hood.
The best source was the JavaScript library jquery which provides a HTML Table based implementation.
See source and documentation at <https://github.com/jeromeetienne/jquery-qrcode>
So the hard work was already done by Jerome Etienne. My part was only to port it to PHP code.
Currently this package does not have the capability to read QRCodes.
Further readings
For a detailed description of QRCode and its features please check <http://www.qrcode.com/>
Trademark information
QR Code is registered trademark of
DENSO WAVE INCORPORATED <http://www.denso-wave.com/qrcode/faqpatent-e.html>
License
All files in the package are published under the terms of the BSD 2 License. <http://opensource.org/licenses/BSD-2-Clause>
|
Applications that use this package |
|
No pages of applications that use this class were specified.
If you know an application of this package, send a message to the author to add a link here.