Qr Code generator using codeigniter

CodeIgniter PHP QR Code

This a library for CodeIgniter Framework to make QR Code from some string given, a porting code fromhttp://phpqrcode.sourceforge.net/.

Installation and Requirements

This library requires CodeIgniter Framework and GD2 PHP extension.

Here i show you how to Integrate PHP QR code library in CodeIgniter.

Setp1: Download and setup CodeIgniter.(https://ellislab.com/codeigniter)

Setp2: Download Qr Code.( https://github.com/dwisetiyadi/CodeIgniter-PHP-QR-Code)

Setp3: Unzip or extract the downloaded qrcode lib files and copy Class directory to application/libraries (folder) and move Ciqrcode.php file to same path.

How to use


header("Content-Type: image/png");

$params['data'] = 'This is a text to encode become QR Code';


Saved QR Code image example


$params['data'] = 'This is a text to encode become QR Code';

$params['level'] = 'H';

$params['size'] = 10;

$params['cachedir'] = FCPATH.'HTML/assets/images/qr_code/';

$params['savename'] = FCPATH.'HTML/assets/images/qr_code/'.'test_1.png';


Optional configuration :


$config['cacheable']    = true; //boolean, the default is true

$config['cachedir']     = ''; //string, the default is application/cache/

$config['errorlog']     = ''; //string, the default is application/logs/

$config['quality']      = true; //boolean, the default is true

$config['size']         = ''; //interger, the default is 1024

$config['black']        = array(224,255,255); // array, default is array(255,255,255)

$config['white']        = array(70,130,180); // array, default is array(0,0,0)


Social Share

Leave a Reply