Home > Backend Development > PHP Tutorial > javascript - What QR code API is generally used to generate QR codes for platform distribution?

javascript - What QR code API is generally used to generate QR codes for platform distribution?

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-06 13:53:42
Original
1237 people have browsed it

What QR code API is generally used to generate QR codes? The purpose is for platform distribution

Reply content:

What QR code API is generally used to generate QR codes? The purpose is for platform distribution

Describe the specific usage scenario. PHP can use the third-party library qrcode

qrcode class library

TP’s

<code>     vendor("phpqrcode.phpqrcode");
        $QRcode = new QRcode();
        $data = $data?$data:'二维码生成有误,联系管理员处理!';
        // 纠错级别:L、M、Q、H
        $level = 'L';
        // 点的大小:1到10,用于手机端4就可以了
        $size = 8;
        //下面注释了把二维码图片保存到本地的代码,如果要保存图片,用$fileName替换第二个参数false
        $path ="./Public/Upload/QrcPic/";
        if(!is_dir($path)){
            mkdir($path,0777,true);
        }
        // 生成的文件名
        $fileName =$prefix.$sid.'.png'; 
        //判断文件是否存在,存在返回二维码图片名字
       // $checkFile = $path.$fileName;
        if(file_exists($checkFile)){
                return $fileName;
                exit;
        } 
        // 输出图处流
        //QRCimg=QRcode::png($data, $fileName, $level, $size, $padding);
        $QRcode->png($data,$path.$fileName,$level,$size, $padding);</code>
Copy after login
Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
What are JavaScript hook functions?
From 1970-01-01 08:00:00
0
0
0
What is JavaScript garbage collection?
From 1970-01-01 08:00:00
0
0
0
c++ calls javascript
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template