QR (Quick Response) code used to read your data in your smart devices for ease. If you have a visiting card and want to add name, email and mobile number in you mobile its hart to type if there is a QR code of contact added on that card then you can easily add that in you contact list by scanning that code. Today i am going to show you how to generate a QR code in PHP.
Create file QRGenerator.php
In a above class we have make many options image size, data etc now showing you examples of it to generate images.
Example 1: Without data it will generate QR code of https://www.phpgang.com/ link.
Example 2: This will generate different url with different image size.
Example 3: This will Generate simple text QR code with different encoding.
1
2
3
4
|
<?php
$ex3 = new QRGenerator('THIS IS JUST A TEXT',100,'ISO-8859-1');
echo "<img src=".$ex3->generate().">";
?>
|
0 comments:
Post a Comment