<?php /** * @title QR Code Example * * @author Pierre-Henry Soria <*****@*****.**> * @copyright (c) 2012-2013, Pierre-Henry Soria. All Rights Reserved. * @license GNU General Public License <http://www.gnu.org/licenses/gpl.html> */ require 'QRCode.class.php'; // Include the QRCode class try { /** * 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')->nickName('PH7')->gender('M')->email('*****@*****.**')->impp('*****@*****.**')->url('http://ph-7.github.com')->note('Hello to all! I am a web developer. As hobbit, I like climbing and swimming ...')->categories('developer,designer,climber,swimmer')->photo('http://files.phpclasses.org/picture/user/1122955.jpg')->lang('en-US')->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>'; }