PHP QR Code是一个PHP二维码生成类库,利用它可以轻松生成名片,官网提供了下载和多个演示demo,查看地址:http://phpqrcode.sourceforge.net/。<?php include "phpqrcode/qrlib.php"; $content = 'BEGIN:VCARD'."\n"; //开始 $content .='VERSION:2.1'."\n"; //版本 $content .='N:张'."\n"; //性 $content .='FN:三丰'."\n"; //名 $content .='ORG:海量'."\n"; //公司地址 $content .='TEL;WORK;VOICE:123456789101'."\n"; //工作单位电话 $content .='ADR;HOME:;;光明路;回民区;呼和浩特;010030;内蒙古'."\n"; //家庭住址 $content .='EMAIL:[email protected]'."\n"; //邮箱 $content .='URL:http:www.bilibili.com'."\n"; //网址 $content .='END:VCARD'."\n"; //结束 QRcode ::png($content); //通过PHP QR Code这个个PHP图片(二维码,名片)生成类库
这里为什么要/qrlib.php 呢? 在调用这种类型的lib文件的时候,只需要配置好头文件.h的路径和库文件.lib的路径,自己的程序就可以正确加载这些第三方代码为自己所用
请看qrlib.php里面有什么
<?php include $QR_BASEDIR."qrconst.php"; include $QR_BASEDIR."qrconfig.php"; include $QR_BASEDIR."qrtools.php"; include $QR_BASEDIR."qrspec.php"; include $QR_BASEDIR."qrimage.php"; include $QR_BASEDIR."qrinput.php"; include $QR_BASEDIR."qrbitstream.php"; include $QR_BASEDIR."qrsplit.php"; include $QR_BASEDIR."qrrscode.php"; include $QR_BASEDIR."qrmask.php"; include $QR_BASEDIR."qrencode.php";