Generate QR Codes using PHP

QR code (Quick Response code) is the trademark for a type of matrix barcode. PHP QR Code is an open-source (LGPL) library for generating QR Code, 2-dimensional barcode. Based on libqrencode C library, provides API for creating QR Code barcode images (PNG, JPEG thanks to GD2). Implemented purely in PHP, with no external dependencies (except GD2 if needed).
In this tutorial we will explain how to Generate QR Codes using PHP. I am using phpqrcode library to generate QR code to store data. This is a very simple example, you can just copy paste and change according to your requirement.
Features:
  • Supports QR Code versions (size) 1-40
  • Numeric, Alphanumeric, 8-bit and Kanji encoding. (Kanji encoding was not fully tested, if you are japan-encoding enabled you can contribute by verifing it 🙂 )
  • Implemented purely in PHP, no external dependencies except GD2
  • Exports to PNG, JPEG images, also exports as bit-table
  • TCPDF 2-D barcode API integration
  • Easy to configure
  • Data cache for calculation speed-up
  • Provided merge tool helps deploy library as a one big dependency-less file, simple to “include and do not wory”
  • Debug data dump, error logging, time benchmarking
  • 100% Open Source, LGPL Licensed
  • for more detail click here
  • download and Extract PHP QR Code Library
Before started to implement the Generate QR Codes using PHP, look files structure:
  • generate-qr-codes-using-php
    • library/phpqrcode
    • css
      • style.css
    • images
    • templates
      • header.php
      • footer.php
    • index.php
    • function.php
Create HTML Form Date input. file named index.php
Generate QR Codes Function. file named function.php
Create files named (header.php and footer.php)
This file contains the header and footer section of the webpage. The Bootstrap library is used to provide a better UI, so, include it in the header and footer section.
header.php
footer.php