{"id":322195,"date":"2019-11-15T09:40:37","date_gmt":"2019-11-15T09:40:37","guid":{"rendered":"https:\/\/www.knowband.com\/blog\/?p=322195\/"},"modified":"2026-01-16T11:20:15","modified_gmt":"2026-01-16T11:20:15","slug":"generate-qr-code-using-php","status":"publish","type":"post","link":"https:\/\/www.knowband.com\/blog\/tips\/generate-qr-code-using-php\/","title":{"rendered":"Generate QR Code Using PHP"},"content":{"rendered":"<p><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">QR code is a type of two dimensional barcode which is abbreviated from <\/span><\/span><strong><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">Quick Response Code<\/span><\/span><\/strong><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\"> . <\/span><span style=\"vertical-align: inherit;\">It is an optical label which contains information about the item. <\/span><span style=\"vertical-align: inherit;\">It is simply attached to the item. <\/span><span style=\"vertical-align: inherit;\">It contains black squares which are arranged in a squares grid with white background.<\/span><\/span><\/p>\n<p class=\"alignnone\"><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">In this blog we will learn how to generate QR code using PHP step by step. <\/span><span style=\"vertical-align: inherit;\">With the help of simple PHP script you can generate QR code for Text, Phone, URL, Email and SMS.<\/span><\/span><a href=\"https:\/\/www.knowband.com\/blog\/wp-content\/uploads\/2019\/11\/Infographic-Main-QR-Code.png\"><br \/>\n<\/a><a href=\"https:\/\/www.knowband.com\/blog\/wp-content\/uploads\/2019\/11\/Infographic-Main-QR-Code-2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-816714\" src=\"https:\/\/www.knowband.com\/blog\/wp-content\/uploads\/2019\/11\/Infographic-Main-QR-Code-2.png\" alt=\"generate QR code for\" width=\"800\" height=\"793\" srcset=\"https:\/\/www.knowband.com\/blog\/wp-content\/uploads\/2019\/11\/Infographic-Main-QR-Code-2.png 800w, https:\/\/www.knowband.com\/blog\/wp-content\/uploads\/2019\/11\/Infographic-Main-QR-Code-2-150x150.png 150w, https:\/\/www.knowband.com\/blog\/wp-content\/uploads\/2019\/11\/Infographic-Main-QR-Code-2-300x297.png 300w, https:\/\/www.knowband.com\/blog\/wp-content\/uploads\/2019\/11\/Infographic-Main-QR-Code-2-768x761.png 768w, https:\/\/www.knowband.com\/blog\/wp-content\/uploads\/2019\/11\/Infographic-Main-QR-Code-2-60x60.png 60w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/a><a href=\"https:\/\/www.knowband.com\/blog\/wp-content\/uploads\/2019\/11\/Infographic-Main-QR-Code-1.png\"><br \/>\n<\/a><\/p>\n<p><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">In this project you need to create two files:<\/span><\/span><\/p>\n<ol>\n<li><strong><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">qrcode.php<\/span><\/span><\/strong><\/li>\n<li><strong><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">index.php<\/span><\/span><\/strong><\/li>\n<\/ol>\n<p><a href=\"https:\/\/www.knowband.com\/blog\/wp-content\/uploads\/2019\/11\/generate-QR-code-using-PHP-step-by-step.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-823181 size-full\" src=\"https:\/\/www.knowband.com\/blog\/wp-content\/uploads\/2019\/11\/generate-QR-code-using-PHP-step-by-step.png\" alt=\"generate QR code using PHP step by step\" width=\"700\" height=\"480\" srcset=\"https:\/\/www.knowband.com\/blog\/wp-content\/uploads\/2019\/11\/generate-QR-code-using-PHP-step-by-step.png 700w, https:\/\/www.knowband.com\/blog\/wp-content\/uploads\/2019\/11\/generate-QR-code-using-PHP-step-by-step-300x206.png 300w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/a><\/p>\n<h3><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">STEP 1: Define class QrCode in qrcode.php:<\/span><\/span><\/h3>\n<p><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">1. Create a class QrCode. <\/span><span style=\"vertical-align: inherit;\">In this class, we will define the URL for GOOGLE CHART API and functions to generate the QR code for Text, Phone, URL, Email and SMS.<\/span><\/span><\/p>\n<pre class=\"brush: actionscript3; gutter: true\">&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;class QrCode {&lt;\/span&gt;&lt;\/span&gt;\r\n&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n}&lt;\/span&gt;&lt;\/span&gt;<\/pre>\n<h3><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">STEP 2: Define URL of Google chart API in QrCode Class:<\/span><\/span><\/h3>\n<p><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">1. We create variables to store the URL of Google chart API and data which is used to create the QR code.<\/span><\/span><\/p>\n<pre class=\"brush: actionscript3; gutter: true\">&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;class QrCode {&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n\/\/URL OF GOOGLE CHART API&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\nprivate $apiUrl = 'https:\/\/chart.apis.google.com\/chart';&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n\/\/ DATA TO CREATE QR CODE&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\nprivate $data;&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n}&lt;\/span&gt;&lt;\/span&gt;<\/pre>\n<h3><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">STEP 3: Define Functions to generate QR code of different types in QrCode Class:<\/span><\/span><\/h3>\n<p><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">We have the following types and functions for the same in which we can generate the QR Code:<\/span><\/span><\/p>\n<p><strong><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">1.URL<\/span><\/span><\/strong><\/p>\n<pre class=\"brush: actionscript3; gutter: true\">&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\/\/ Function which is used to generate the URL type of QR Code.&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\npublic function URL($url = null) {&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n$this-&amp;gt;data = preg_match(\"#^https?\\:\\\/\\\/#\", $url) ? &lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;$url : \"https:\/\/{$url}\";&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n}&lt;\/span&gt;&lt;\/span&gt;<\/pre>\n<p><strong><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">2.Text<\/span><\/span><\/strong><\/p>\n<pre class=\"brush: actionscript3; gutter: true\">&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\/\/ Function which is used to generate the TEXT type of QR Code.&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\npublic function TEXT($text) {&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n$this-&amp;gt;data = $text;&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n}&lt;\/span&gt;&lt;\/span&gt;<\/pre>\n<p><strong><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">3. EMAIL<\/span><\/span><\/strong><\/p>\n<pre class=\"brush: actionscript3; gutter: true\">&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\/\/ Function which is used to generate the EMAIL type of QR Code.&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\npublic function EMAIL($email = null, $subject = null, $message = null) {&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n$this-&amp;gt;data = \"MATMSG:TO:{$email};SUB:{$subject};BODY:{$message};;\";&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n}&lt;\/span&gt;&lt;\/span&gt;<\/pre>\n<p><strong><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">4.PHONE<\/span><\/span><\/strong><\/p>\n<pre class=\"brush: actionscript3; gutter: true\">&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\/\/ Function which is used to generate the PHONE type of QR Code.&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\npublic function PHONE($phone) {&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n$this-&amp;gt;data = \"TEL:{$phone}\";&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n}&lt;\/span&gt;&lt;\/span&gt;<\/pre>\n<p><strong><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">5.SMS<\/span><\/span><\/strong><\/p>\n<pre class=\"brush: actionscript3; gutter: true\">&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\/\/ Function which is used to generate the SMS type of QR Code.&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\npublic function SMS($phone = null, $msg = null) {&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n$this-&amp;gt;data = \"SMSTO:{$phone}:{$msg}\";&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n}&lt;\/span&gt;&lt;\/span&gt;<\/pre>\n<p><strong><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">6. CONTACT<\/span><\/span><\/strong><\/p>\n<div class=\"module_in_content_container\">\n<div class=\"module_content\">\n<p><img loading=\"lazy\" decoding=\"async\" class=\"module_image\" src=\"https:\/\/cdn.knowband.com\/image\/cache\/data\/chatgpt-chatbot-module-ps-740x740.webp\" alt=\"Launch your mobile app using Knowband's Opencart Mobile App Builder\" width=\"100\" height=\"100\" \/><\/p>\n<div class=\"module_content_part\">\n<h3 class=\"title\">Prestashop AI Chatbot Addon<\/h3>\n<p class=\"module_content_text\">Create and launch a perfect AI Chatbot created using PHP for prestashop store.<\/p>\n<p><a class=\"link_2_to_module\" style=\"display: inline-block; color: #f36!important;\" href=\"https:\/\/www.knowband.com\/prestashop-chatbot-module\" target=\"_blank\" rel=\"noopener\"><br \/>\n<span class=\"read-more\">Try the Demo<\/span><\/a><\/p>\n<\/div>\n<\/div>\n<\/div>\n<pre class=\"brush: actionscript3; gutter: true\">&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\/\/ Function which is used to generate the CONTACT type of QR Code.&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\npublic function CONTACT($name = null, $address = null, $phone = null, $email = null) {&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n$this-&amp;gt;data = \"MECARD:N:{$name};ADR:{$address};TEL:{$phone};EMAIL:{$email};;\";&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n}&lt;\/span&gt;&lt;\/span&gt;<\/pre>\n<h3><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">STEP 4: Define Functions to save the QR Code image in QrCode Class:<\/span><\/span><\/h3>\n<pre class=\"brush: actionscript3; gutter: true\">&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\/\/Function which is used to save the qrcode image file.&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\npublic function QRCODE($size = 400, $filename = null) {&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n$ch = curl_init();&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\ncurl_setopt($ch, CURLOPT_URL, $this-&amp;gt;apiUrl);&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\ncurl_setopt($ch, CURLOPT_POST, true);&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\ncurl_setopt($ch, CURLOPT_POSTFIELDS, \"chs={$size}x{$size}&amp;amp;cht=qr&amp;amp;chl=\" . urlencode($this-&amp;gt;data));&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\ncurl_setopt($ch, CURLOPT_HEADER, false);&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\ncurl_setopt($ch, CURLOPT_TIMEOUT, 30);&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n$img = curl_exec($ch);&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\ncurl_close($ch);&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\nif ($img) {&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\nif ($filename) {&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\nif (!preg_match(\"#\\.png$#i\", $filename)) {&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n$filename .= \".png\";&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n}&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\nreturn file_put_contents($filename, $img);&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n} else {&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\nheader(\"Content-type: image\/png\");&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\nprint $img;&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\nreturn true;&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n}&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n}&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\nreturn false;&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n}&lt;\/span&gt;&lt;\/span&gt;<\/pre>\n<h3><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">STEP 5: Create a new file index.php.<\/span><\/span><\/h3>\n<p><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">1. In this file we call the function to generate the QR Code of different types which we defined in qrcode.php.<\/span><\/span><\/p>\n<p><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">2. To generate the <\/span><\/span><strong><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">Text QR code<\/span><\/span><\/strong><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\"> you need to call the TEXT function in your index.php file.<\/span><\/span><\/p>\n<pre class=\"brush: actionscript3; gutter: true\">&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&amp;lt;?php&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n\/\/ Include qrcode.php file.&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\ninclude \"qrcode.php\";&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n\/\/ Create objects&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n$qc = new QRCODE();&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n\/\/ Create Text Code&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n$qc-&amp;gt;TEXT(\"Knowband\");&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n\/\/ Save QR Code&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n$qc-&amp;gt;QRCODE(400,\"Knowband_text.png\");&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n?&amp;gt;&lt;\/span&gt;&lt;\/span&gt;<\/pre>\n<p><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">3. To generate the URL QR code you need to call the URL function in your index.php file.<\/span><\/span><\/p>\n<pre class=\"brush: actionscript3; gutter: true\">&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&amp;lt;?php&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n\/\/ Include qrcode.php file.&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\ninclude \"qrcode.php\";&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n\/\/ Create objects&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n$qc = new QRCODE();&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n\/\/ Create URL Code&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n$qc-&amp;gt;URL(\"Knowband.com\");&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n\/\/ Save QR Code&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n$qc-&amp;gt;QRCODE(400,\"Knowband_url.png\");&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n?&amp;gt;&lt;\/span&gt;&lt;\/span&gt;<\/pre>\n<p><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">4. To generate the EMAIL QR code you need to call the EMAIL function in your index.php file.<\/span><\/span><\/p>\n<pre class=\"brush: actionscript3; gutter: true\">&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&amp;lt;?php&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n\/\/ Include qrcode.php file.&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\ninclude \"qrcode.php\";&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n\/\/ Create objects&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n$qc = new QRCODE();&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n\/\/ Create EMAIL Code&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n$qc-&amp;gt;EMAIL(\"Knowband@test.com\",\"Subject\",\"Message\");&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n\/\/ Save QR Code&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n$qc-&amp;gt;QRCODE(400,\"Knowband_email.png\");&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n?&amp;gt;&lt;\/span&gt;&lt;\/span&gt;<\/pre>\n<p><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">5. To generate the PHONE QR code you need to call the PHONE function in your index.php file.<\/span><\/span><\/p>\n<pre class=\"brush: actionscript3; gutter: true\">&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&amp;lt;?php&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n\/\/ Include qrcode.php file.&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\ninclude \"qrcode.php\";&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n\/\/ Create objects&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n$qc = new QRCODE();&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n\/\/ Create PHONE Code&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n$qc-&amp;gt;PHONE(\"1234567890\");&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n\/\/ Save QR Code&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n$qc-&amp;gt;QRCODE(400,\"Knowband_phone.png\");&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n?&amp;gt;&lt;\/span&gt;&lt;\/span&gt;<\/pre>\n<p><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">6. To generate the SMS QR code you need to call the SMS function in your index.php file.<\/span><\/span><\/p>\n<pre class=\"brush: actionscript3; gutter: true\">&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&amp;lt;?php&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n\/\/ Include qrcode.php file.&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\ninclude \"qrcode.php\";&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n\/\/ Create objects&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n$qc = new QRCODE();&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n\/\/ Create SMS Code&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n$qc-&amp;gt;SMS(\"1234567890\");&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n\/\/ Save QR Code&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n$qc-&amp;gt;QRCODE(400,\"Knowband_sms.png\");&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n?&amp;gt;&lt;\/span&gt;&lt;\/span&gt;<\/pre>\n<p><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">7. To generate the CONTACT QR code you need to call the CONTACT function in your index.php file.<\/span><\/span><\/p>\n<pre class=\"brush: actionscript3; gutter: true\">&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&amp;lt;?php&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n\/\/ Include qrcode.php file.&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\ninclude \"qrcode.php\";&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n\/\/ Create objects&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n$qc = new QRCODE();&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n\/\/ Create CONTACT Code&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n$qc-&amp;gt;CONTACT(\"knowband\",\"Address\",\"1234567890\",\"knowband@test.com\");&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n\/\/ Save QR Code&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n$qc-&amp;gt;QRCODE(400,\"Knowband_contact.png\");&lt;\/span&gt;&lt;\/span&gt;&lt;span style=\"vertical-align: inherit;\"&gt;&lt;span style=\"vertical-align: inherit;\"&gt;\r\n?&amp;gt;&lt;\/span&gt;&lt;\/span&gt;<\/pre>\n<h3><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">STEP 6: Run script file (index.php) in your environment:<\/span><\/span><\/h3>\n<p><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">If all goes well then the filename will be named &#8220;knowband_text.png&#8221; and other which you want downloaded and saved in your computer.<\/span><\/span><\/p>\n<p><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">NOTE: You can generate only 1 type of QR Code at a time.<\/span><\/span><\/p>\n<p><a href=\"https:\/\/www.knowband.com\/blog\/wp-content\/uploads\/2019\/11\/Downloads.zip\" target=\"_blank\" rel=\"noopener\"><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\">Click here<\/span><\/span><\/a><span style=\"vertical-align: inherit;\"><span style=\"vertical-align: inherit;\"> to download the complete code.<\/span><\/span><\/p>\n<p><span style=\"font-weight: 400;\">With 13+ years of excellence in information technology, we provide web and app development technologies on various frameworks. You can also explore a wide range of Prestashop, Opencart, WooCommerce, Shopify, and Magento 2 ready-to-use eCommerce extensions.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">In case you have queries\/suggestions, you can reach out to our technical support portal at our email address <\/span><a href=\"mailto:support@knowband.com\"><span style=\"font-weight: 400;\">support@knowband.com<\/span><\/a><span style=\"font-weight: 400;\">.<\/span><\/p>\n<p>Take a look at our bestseller module <a href=\"https:\/\/www.knowband.com\/prestashop-one-page-supercheckout\">One Page Supercheckout for Prestashop<\/a><span data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;Opencart Android and iOS Mobile App Builder Plugin&quot;}\" data-sheets-userformat=\"{&quot;2&quot;:513,&quot;3&quot;:{&quot;1&quot;:0},&quot;12&quot;:0}\">\u00a0<\/span>here:<\/p>\n<div class=\"module_in_content_container\">\n<div class=\"module_content\">\n<p><img loading=\"lazy\" decoding=\"async\" class=\"module_image\" src=\"https:\/\/www.knowband.com\/image\/cache\/data\/Plugin%20Logo\/one-page-checkout-740x740.png\" alt=\"Knowband - Prestashop One Page Checkout Addon\" width=\"100\" height=\"100\" \/><\/p>\n<div class=\"module_content_part\">\n<h3 class=\"title\">Prestashop One Page Checkout Addon<\/h3>\n<p class=\"module_content_text\">The Prestashop One Page Checkout by Knowband simplifies the checkout process, enhancing user experience and boosting conversions for your online store.<\/p>\n<p><a class=\"link_2_to_module\" style=\"display: inline-block; color: #f36!important;\" href=\"https:\/\/www.knowband.com\/prestashop-one-page-supercheckout\" target=\"_blank\" rel=\"noopener\"><span class=\"read-more\">VISIT HERE<\/span><\/a><\/p>\n<\/div>\n<\/div>\n<\/div>\n<style>\n.module_in_content_container { display: flex; flex-direction: column; padding: 20px; border: 1px solid #ccc; font-size: 16px; line-height: 26px; box-shadow: 0 3px 0 #ebebeb; -webkit-box-shadow: 0 3px 0 #ebebeb; position: relative; margin-bottom: 1.5em; } .module_in_content_container>a { position: absolute; left: 0; top: 0; width: 100%; height: 100%; } .module_content { display: flex; align-items: flex-start; } .module_content img { max-width: 100px; margin-right: 20px; } .module_content_part p.module_content_text { margin-bottom: 10px; margin-top: 0; font-size: 18px; color: #000; } .module_content h3 { font-size: 24px; font-weight: 700; line-height: 1.5em; padding-left: 0; padding-top: 0; margin: 0; } .read-more { font-size: 18px; font-weight: 700; line-height: 1.5em; position: relative; display: inline-block; text-transform: uppercase; color: #f36; } .read-more:after { position: absolute; content: ''; width: 1.5em; height: 1.5em; top: -1px; right: -1.5em; background: url(https:\/\/knowband.com\/mobile-app\/wp-content\/uploads\/images\/readmore-arrow.svg) no-repeat center \/ .75em; transition: all .2s; } .read-more:focus, .read-more:hover { text-decoration: none; cursor: pointer; } .read-more:hover:after { right: -2em; transition: all .2s; } @media (max-width: 600px) { .module_content { flex-direction: column; align-items: center; text-align: center; } .module_content img { margin: 0 auto 20px auto; max-width: 100%; } .module_content .title { flex-basis: auto; margin-top: 20px; } .module_content_part p.module_content_text { font-size: 16px; line-height: 24px; } .read-more { font-size: 16px;}}<\/style>\n<p>For more information of Prestashop One Page Checkout module, visit: <a href=\"https:\/\/www.prestacheckout.com\/\">https:\/\/www.prestacheckout.com\/<\/a><\/p>\n<p><iframe loading=\"lazy\" title=\"YouTube video player\" src=\"https:\/\/www.youtube.com\/embed\/1yLcXToR6-g\" width=\"660\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>QR code is a type of two dimensional barcode which is abbreviated from Quick Response Code . It is an optical label which contains information about the item. It is simply attached to the item. It contains black squares which are arranged in a squares grid with white background. In this blog we will learn [&hellip;]<\/p>\n","protected":false},"author":29,"featured_media":816481,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_kbui_enabled":"","footnotes":""},"categories":[4,1111],"tags":[18477,33162,7509,18476,18478],"class_list":["post-322195","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ecommerce-blog","category-tips","tag-generate-qr-code-using-php","tag-one-page-supercheckout-for-prestashop","tag-php","tag-qr-code-generation","tag-tips-to-generate-qr-code"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Generate QR Code Using PHP | Technical Blog | PHP | Knowband<\/title>\n<meta name=\"description\" content=\"Learn how to generate QR code using PHP step by step. With the help of simple PHP script you can generate QR code for Text, Phone, URL, Email and SMS.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.knowband.com\/blog\/tips\/generate-qr-code-using-php\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Generate QR Code Using PHP | Technical Blog | PHP | Knowband\" \/>\n<meta property=\"og:description\" content=\"Learn how to generate QR code using PHP step by step. With the help of simple PHP script you can generate QR code for Text, Phone, URL, Email and SMS.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.knowband.com\/blog\/tips\/generate-qr-code-using-php\/\" \/>\n<meta property=\"og:site_name\" content=\"Knowband Blog | Ecommerce Modules\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Knowband\" \/>\n<meta property=\"article:published_time\" content=\"2019-11-15T09:40:37+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-01-16T11:20:15+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.knowband.com\/blog\/wp-content\/uploads\/2019\/11\/Generate-QR.png\" \/>\n\t<meta property=\"og:image:width\" content=\"760\" \/>\n\t<meta property=\"og:image:height\" content=\"300\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Varnit Singhal\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@KnowbandPlugin\" \/>\n<meta name=\"twitter:site\" content=\"@KnowbandPlugin\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Varnit Singhal\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/tips\\\/generate-qr-code-using-php\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/tips\\\/generate-qr-code-using-php\\\/\"},\"author\":{\"name\":\"Varnit Singhal\",\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/fr\\\/#\\\/schema\\\/person\\\/a884cf42a4b8d34e9826384c5da29e3e\"},\"headline\":\"Generate QR Code Using PHP\",\"datePublished\":\"2019-11-15T09:40:37+00:00\",\"dateModified\":\"2026-01-16T11:20:15+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/tips\\\/generate-qr-code-using-php\\\/\"},\"wordCount\":538,\"publisher\":{\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/fr\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/tips\\\/generate-qr-code-using-php\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/11\\\/Generate-QR.png\",\"keywords\":[\"Generate QR Code Using PHP\",\"one page supercheckout for prestashop\",\"PHP\",\"QR Code generation\",\"tips to generate QR code\"],\"articleSection\":[\"Ecommerce\",\"Tips\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/tips\\\/generate-qr-code-using-php\\\/\",\"url\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/tips\\\/generate-qr-code-using-php\\\/\",\"name\":\"Generate QR Code Using PHP | Technical Blog | PHP | Knowband\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/fr\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/tips\\\/generate-qr-code-using-php\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/tips\\\/generate-qr-code-using-php\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/11\\\/Generate-QR.png\",\"datePublished\":\"2019-11-15T09:40:37+00:00\",\"dateModified\":\"2026-01-16T11:20:15+00:00\",\"description\":\"Learn how to generate QR code using PHP step by step. With the help of simple PHP script you can generate QR code for Text, Phone, URL, Email and SMS.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/tips\\\/generate-qr-code-using-php\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.knowband.com\\\/blog\\\/tips\\\/generate-qr-code-using-php\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/tips\\\/generate-qr-code-using-php\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/11\\\/Generate-QR.png\",\"contentUrl\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/11\\\/Generate-QR.png\",\"width\":760,\"height\":300,\"caption\":\"Knowband guide for generating QR codes in PHP\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/tips\\\/generate-qr-code-using-php\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/fr\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Generate QR Code Using PHP\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/fr\\\/#website\",\"url\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/fr\\\/\",\"name\":\"Knowband Blog | Ecommerce Modules\",\"description\":\"Magento, Prestashop, Opencart, Shopify\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/fr\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/fr\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/fr\\\/#organization\",\"name\":\"Knowband Blog | Ecommerce Modules\",\"url\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/fr\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/fr\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/wp-content\\\/uploads\\\/2016\\\/09\\\/cropped-knowband_logo-v2.png\",\"contentUrl\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/wp-content\\\/uploads\\\/2016\\\/09\\\/cropped-knowband_logo-v2.png\",\"width\":153,\"height\":61,\"caption\":\"Knowband Blog | Ecommerce Modules\"},\"image\":{\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/fr\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/Knowband\",\"https:\\\/\\\/x.com\\\/KnowbandPlugin\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/fr\\\/#\\\/schema\\\/person\\\/a884cf42a4b8d34e9826384c5da29e3e\",\"name\":\"Varnit Singhal\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/11\\\/2019-11-06-150x150.jpg\",\"url\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/11\\\/2019-11-06-150x150.jpg\",\"contentUrl\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/11\\\/2019-11-06-150x150.jpg\",\"caption\":\"Varnit Singhal\"},\"url\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/author\\\/vsinghal\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Generate QR Code Using PHP | Technical Blog | PHP | Knowband","description":"Learn how to generate QR code using PHP step by step. With the help of simple PHP script you can generate QR code for Text, Phone, URL, Email and SMS.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.knowband.com\/blog\/tips\/generate-qr-code-using-php\/","og_locale":"en_US","og_type":"article","og_title":"Generate QR Code Using PHP | Technical Blog | PHP | Knowband","og_description":"Learn how to generate QR code using PHP step by step. With the help of simple PHP script you can generate QR code for Text, Phone, URL, Email and SMS.","og_url":"https:\/\/www.knowband.com\/blog\/tips\/generate-qr-code-using-php\/","og_site_name":"Knowband Blog | Ecommerce Modules","article_publisher":"https:\/\/www.facebook.com\/Knowband","article_published_time":"2019-11-15T09:40:37+00:00","article_modified_time":"2026-01-16T11:20:15+00:00","og_image":[{"width":760,"height":300,"url":"https:\/\/www.knowband.com\/blog\/wp-content\/uploads\/2019\/11\/Generate-QR.png","type":"image\/png"}],"author":"Varnit Singhal","twitter_card":"summary_large_image","twitter_creator":"@KnowbandPlugin","twitter_site":"@KnowbandPlugin","twitter_misc":{"Written by":"Varnit Singhal","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.knowband.com\/blog\/tips\/generate-qr-code-using-php\/#article","isPartOf":{"@id":"https:\/\/www.knowband.com\/blog\/tips\/generate-qr-code-using-php\/"},"author":{"name":"Varnit Singhal","@id":"https:\/\/www.knowband.com\/blog\/fr\/#\/schema\/person\/a884cf42a4b8d34e9826384c5da29e3e"},"headline":"Generate QR Code Using PHP","datePublished":"2019-11-15T09:40:37+00:00","dateModified":"2026-01-16T11:20:15+00:00","mainEntityOfPage":{"@id":"https:\/\/www.knowband.com\/blog\/tips\/generate-qr-code-using-php\/"},"wordCount":538,"publisher":{"@id":"https:\/\/www.knowband.com\/blog\/fr\/#organization"},"image":{"@id":"https:\/\/www.knowband.com\/blog\/tips\/generate-qr-code-using-php\/#primaryimage"},"thumbnailUrl":"https:\/\/www.knowband.com\/blog\/wp-content\/uploads\/2019\/11\/Generate-QR.png","keywords":["Generate QR Code Using PHP","one page supercheckout for prestashop","PHP","QR Code generation","tips to generate QR code"],"articleSection":["Ecommerce","Tips"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.knowband.com\/blog\/tips\/generate-qr-code-using-php\/","url":"https:\/\/www.knowband.com\/blog\/tips\/generate-qr-code-using-php\/","name":"Generate QR Code Using PHP | Technical Blog | PHP | Knowband","isPartOf":{"@id":"https:\/\/www.knowband.com\/blog\/fr\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.knowband.com\/blog\/tips\/generate-qr-code-using-php\/#primaryimage"},"image":{"@id":"https:\/\/www.knowband.com\/blog\/tips\/generate-qr-code-using-php\/#primaryimage"},"thumbnailUrl":"https:\/\/www.knowband.com\/blog\/wp-content\/uploads\/2019\/11\/Generate-QR.png","datePublished":"2019-11-15T09:40:37+00:00","dateModified":"2026-01-16T11:20:15+00:00","description":"Learn how to generate QR code using PHP step by step. With the help of simple PHP script you can generate QR code for Text, Phone, URL, Email and SMS.","breadcrumb":{"@id":"https:\/\/www.knowband.com\/blog\/tips\/generate-qr-code-using-php\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.knowband.com\/blog\/tips\/generate-qr-code-using-php\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.knowband.com\/blog\/tips\/generate-qr-code-using-php\/#primaryimage","url":"https:\/\/www.knowband.com\/blog\/wp-content\/uploads\/2019\/11\/Generate-QR.png","contentUrl":"https:\/\/www.knowband.com\/blog\/wp-content\/uploads\/2019\/11\/Generate-QR.png","width":760,"height":300,"caption":"Knowband guide for generating QR codes in PHP"},{"@type":"BreadcrumbList","@id":"https:\/\/www.knowband.com\/blog\/tips\/generate-qr-code-using-php\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.knowband.com\/blog\/fr\/"},{"@type":"ListItem","position":2,"name":"Generate QR Code Using PHP"}]},{"@type":"WebSite","@id":"https:\/\/www.knowband.com\/blog\/fr\/#website","url":"https:\/\/www.knowband.com\/blog\/fr\/","name":"Knowband Blog | Ecommerce Modules","description":"Magento, Prestashop, Opencart, Shopify","publisher":{"@id":"https:\/\/www.knowband.com\/blog\/fr\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.knowband.com\/blog\/fr\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.knowband.com\/blog\/fr\/#organization","name":"Knowband Blog | Ecommerce Modules","url":"https:\/\/www.knowband.com\/blog\/fr\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.knowband.com\/blog\/fr\/#\/schema\/logo\/image\/","url":"https:\/\/www.knowband.com\/blog\/wp-content\/uploads\/2016\/09\/cropped-knowband_logo-v2.png","contentUrl":"https:\/\/www.knowband.com\/blog\/wp-content\/uploads\/2016\/09\/cropped-knowband_logo-v2.png","width":153,"height":61,"caption":"Knowband Blog | Ecommerce Modules"},"image":{"@id":"https:\/\/www.knowband.com\/blog\/fr\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/Knowband","https:\/\/x.com\/KnowbandPlugin"]},{"@type":"Person","@id":"https:\/\/www.knowband.com\/blog\/fr\/#\/schema\/person\/a884cf42a4b8d34e9826384c5da29e3e","name":"Varnit Singhal","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.knowband.com\/blog\/wp-content\/uploads\/2019\/11\/2019-11-06-150x150.jpg","url":"https:\/\/www.knowband.com\/blog\/wp-content\/uploads\/2019\/11\/2019-11-06-150x150.jpg","contentUrl":"https:\/\/www.knowband.com\/blog\/wp-content\/uploads\/2019\/11\/2019-11-06-150x150.jpg","caption":"Varnit Singhal"},"url":"https:\/\/www.knowband.com\/blog\/author\/vsinghal\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.knowband.com\/blog\/wp-json\/wp\/v2\/posts\/322195","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.knowband.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.knowband.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.knowband.com\/blog\/wp-json\/wp\/v2\/users\/29"}],"replies":[{"embeddable":true,"href":"https:\/\/www.knowband.com\/blog\/wp-json\/wp\/v2\/comments?post=322195"}],"version-history":[{"count":22,"href":"https:\/\/www.knowband.com\/blog\/wp-json\/wp\/v2\/posts\/322195\/revisions"}],"predecessor-version":[{"id":834492,"href":"https:\/\/www.knowband.com\/blog\/wp-json\/wp\/v2\/posts\/322195\/revisions\/834492"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.knowband.com\/blog\/wp-json\/wp\/v2\/media\/816481"}],"wp:attachment":[{"href":"https:\/\/www.knowband.com\/blog\/wp-json\/wp\/v2\/media?parent=322195"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.knowband.com\/blog\/wp-json\/wp\/v2\/categories?post=322195"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.knowband.com\/blog\/wp-json\/wp\/v2\/tags?post=322195"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}