提供一个好用的二维码接口

浏览:1041 发布日期:2014/11/22 分类:技术分享
新手新手,纯是为了交流。
函数    function get_qr_code($data="",$level='M',$size='6'){
        
        $url="http://qrcode.zaiyoudao.com/open.php?data=$data&level=$level&size=$size";
        
        $img = file_get_contents($url); 
        
        return $img;
        
    }
控制器<?php
namespace Test\Controller;
use Think\Controller;
class IndexController extends Controller {
    
    public function index(){
        
        $data= I('param.data');
        
        $url = get_qr_code($data);
        
        $this->assign('url',$url);

        $this->display();

        
    }    
    
}
视图随意
最佳答案
评论( 相关
后面还有条评论,点击查看>>