PHP QR Code Generator Class

By Shay Anderson on May 2010
Here is my PHP QR code generator class that creates PNG QR code images from text. The class will create various QR code types like text, URLs, emails, etc:
BarcodeQR.zip or BarcodeQR.tgz

Requirements: PHP Web server and cURL Library (client URL).

The PHP QR code class will create a PNG QR code image or save a PNG QR code image file, here is an example: // include BarcodeQR class
include "BarcodeQR.php";

// set BarcodeQR object
$qr = new BarcodeQR();

// create URL QR code
$qr->url("www.shayanderson.com");

// display new QR code image
$qr->draw();
This example will create and display this QR code image:

You can also save the QR code PNG image like this: // save new QR code image (size 150x150)
$qr->draw(150, "tmp/qr-code.png");
Other QR code types the class will create:// bookmark
$qr->bookmark("title", "url");

// contact
$qr->contact("name", "address", "phone", "email");

// content
$qr->content("type", "size", "content");

// email
$qr->email("email", "subject", "message");

// geo location
$qr->geo("lat", "lon", "height");

// phone
$qr->phone("phone");

// sms
$qr->sms("phone", "text");

// text
$qr->text("text");

// URL
$qr->url("url");

// wifi connection
$qr->wifi("type", "ssid", "password");


If you need a PHP Barcode Code 39 generator check out my Barcode 39 generator