Location: PHPKode > scripts > QR code generator > QRCode-Generator-PHP-Class-master/example.php
<?php
/**
 * @title            QR Code Example
 *
 * @author           Pierre-Henry Soria <hide@address.com>
 * @copyright        (c) 2012, Pierre-Henry Soria. All Rights Reserved.
 * @license          GNU General Public License.
 */

require 'QRCode.class.php';

try
{

    /**
     * If you have PHP 5.4 or higher, you can instantiate the object like this:
     * $oQRC = (new QRCode) // 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('hide@address.com') // Add Email Address
        ->impp('hide@address.com') // Add Instant Messenger
        ->url('http://ph-7.github.com') // Add URL Website
        ->note('Hello to all! I am a web developer. As hobbit, I like climbing and swimming ...') // Add Note
        ->categories('developer,designer,climber,swimmer') // Add Categories
        ->photo('http://files.phpclasses.org/picture/user/1122955.jpg') // 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(); // Display

}
catch (Exception $oExcept)
{
    echo '<p><b>Exception launched!</b><br /><br />' .
    'Message: ' . $oExcept->getMessage() . '<br />' .
    'File: ' . $oExcept->getFile() . '<br />' .
    'Line: ' . $oExcept->getLine() . '<br />' .
    'Trace: <p/><pre>' . $oExcept->getTraceAsString() . '</pre>';
}
Return current item: QR code generator