paint-brush
Simple Guide to Generating QR Code in PHPby@discussdesk
4,017 reads
4,017 reads

Simple Guide to Generating QR Code in PHP

by Abhigyan singhOctober 2nd, 2020
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

A QR code (Quick Response code) is a two-dimensional Barcode that is first designed in 1994 for use in the automotive industry in Japan. It is a machine-readable label that contains some amount of information about the product or item. This QR code can be easily scanned by any scanner device and able to read the stored information. These generated QR codes can also be stored in the database by its generated name for further use in our application. There are several QR code generators is available online but there are some situations where we need to integrate custom code.

Company Mentioned

Mention Thumbnail
featured image - Simple Guide to Generating QR Code in PHP
Abhigyan singh HackerNoon profile picture

These days, the term QR code is gaining more popularity due to its common use in daily routine life. It is commonly used in online shopping and digital payment. A QR code (Quick Response code) is a two-dimensional Barcode that is first designed in 1994 for use in the automotive industry in Japan.

It is a machine-readable label that contains some amount of information about the product or item. This QR code can be easily scanned by any scanner device and able to read the stored information.

In this article, I will show you to easily generate QR code in PHP. I have used PHP as a language to generate QR code because it is a widely used language online. Now I will be the PHP QR Code library to generate QR code.

There are several QR code generators is available online but there are some situations where we need to integrate custom code in our application. So this tutorial will get more insight to generate QR code using PHP.

Here I will create a file in PHP called index.php :

<?php
include('library/php_qr_code/qrlib.php');
$frm_link ="";
$filename="";
$errorCorrectionLevel="";
$matrixPointSize="";
$framePointSize="";

QRcode::png($frm_link, $filename, $errorCorrectionLevel, $matrixPointSize, $framePointSize);

?>

These are the arguments passed in above function QRcode::png()

$frm_link : This is the input parameter for which QR code need to generate.

$filename: The path or location to store the generated QR code.

$errorCorrectionLevel : It specifies the capability of error correction in QR code.

$matrixPointSize : It is the pixel size of QR code.

$framePointSize: This parameter tells the complete size of QR code.

These generated QR codes can also be stored in the database by its generated name for further use in our application.

Previously published at https://www.discussdesk.com/how-to-generate-qr-code-using-php.htm