Generate QR Code For URL in PHP

Welcome to freeonlinetest tutorials, here you will learn how to generate QR code for URL using PHP library.
PHP provides several library for generating QR code like phpqrcode library and tc-lib-barcode library.



QR Code stands for Quick Response code. By using this, we can replace a large amount of information, such as smart card data, consumer advertising, website urls, telephone numbers, articles, and much more, into just a two-dimensional matrix Barcode.

It is capable of storing up to 4,296 alphanumeric characters of arbitrary text.



QR Code Generation Using PHP


In this section, you can do this QR code generation by two methods

Generating QR Code using tc-lib-barcode library

 

 



 

Step-1

Download composer, if you dont have composer in your machine.
Click here to download Composer

Step-2

Run this code on your working folder, and make sure it will be in your root folder. See the example below screenshot.



Step-3

Put this below code in index.php

 

Generating QR Code using phpqrcode library in PHP

 

Step-1

Download the qrcode library from GitHub or download it from below link



Click here download

Step-2

Now paste this below code in your index.php, then it will work fine.

 



Tags: ,