PHP Classes


Recommend this page to a friend!
  Classes of Pierre-Henry Soria   QR Code Generate   Download  
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: QR Code Generate
Generate QRCode images using Google Charts API
Author: By
Last change: Update of
Date: 3 months ago
Size: 2,370 bytes


Class file image Download

🚀 PHP QR Code 📱

Scrutinizer Quality Score


QRCode PHP class allows you to easily generate a simple QR code using vCard 4.0 and the Google Chart API.

Here are two videos explaining QR code: and

Composer Installation

You can add it easily in your project by using Composer.

$ composer require ph-7/qrcode-generator-php-class

Then, include Composer's autoload

require_once 'vendor/autoload.php';

Manual Installation

If you don't use Composer, you can install it without Composer by simply including the class

require 'QRCode.class.php';

How to Use

Here's a basic example:

 * If you have PHP 5.4 or higher, you can instantiate the object like this:
 * (new QRCode)->fullName('...')->... // Create vCard Object
$oQRC = new QRCode; // Create vCard Object
$oQRC->fullName('Pierre-Henry Soria') // Add Full Name
    ->nickName('PH7') // Add Nickname
    ->gender('M') // Add Gender
    ->email('') // Add Email Address
    ->impp('') // Add Instant Messenger
    ->url('') // Add URL Website
    ->note('Hello to all! I am a web developer. As hobbies I like climbing and swimming ...') // Add Note
    ->categories('developer,designer,climber,swimmer') // Add Categories
    ->photo('') // Add Avatar
    ->lang('en-US') // Add Language
    ->finish(); // End vCard

// echo '<p><img src="' . $oQRC->get(300) . '" alt="QR Code" /></p>'; // Generate and display the QR Code
$oQRC->display(300); // Set size and display QR Code default 150px

You also have a sample file here:

Server Requirements

PHP 5.2.4 or higher.


Pierre-Henry Soria


Contact me at: pierrehenrysoria [[AT]] gmail [[D0T]] com


General Public License 3 or later; See the LICENSE.txt file.