- phpqrcode源码下载
http://phpqrcode.sourceforge.net/
二维码在线识别 http://jiema.wwei.cn/
代码实现
public function doMobilePhpqrcode()
{
// 全局变量
global $_W, $_GPC;
// 微信用户信息
$userinfo = mc_oauth_userinfo($_W['uniacid']);
//生成二维码
require IA_ROOT . '/addons/health_moniter/phpqrcode/qrlib.php';
//生成二维码
// QRcode::png('https://www.baidu.com');
$url = "https://www.baidu.com";
$value = $url;
$errorCorrectionLevel = "L";
$matrixPointSize = "4.3";
$margin = "1";
// 判断二维码文件是否存在,如果存在就不写入
// $file = IA_ROOT . '/addons/health_moniter/qrcode/' . $userinfo['openid'] . '.png';
// if(!file_exists($file)){
// QRcode::png($value, IA_ROOT . '/addons/health_moniter/qrcode/' . $userinfo['openid'] . '.png', $errorCorrectionLevel, $matrixPointSize, $margin);
//
// }
QRcode::png($value, HEALTH_MONITER_QRCODE . $userinfo['openid'] . '.png', $errorCorrectionLevel, $matrixPointSize, $margin);
include $this->template('phpqrcode');
}
HEALTH_MONITER_QRCODE
是自己定义的常量
网友评论