简体   繁体   English

使用phpqrcode库生成一批QR码

[英]Generate Batch of QR codes using phpqrcode library

Im using phpqrcode library to generate the qrcode. 我正在使用phpqrcode库生成qrcode。

for($i=1;$i<=600;$i++){
   $fileName = 'qrcode_name' . $i . '.png';
   QRcode::png($i, $fileName); 
}

If i want to display all those qr codes in webpage instead of storing in a file, im using this code, 如果我想在网页中显示所有这些二维码而不是存储在文件中,我将使用此代码,

QRcode::png("VALUE");

But how can make to code to display all the QR code at once in my webpage, instead of storing it in intermediate file. 但是如何使代码一次显示所有QR码,而不是将其存储在中间文件中。

Is it possible to do like that? 有可能这样做吗?

As you know, the phpqrcode library save png file in the server, the save path is a local physical path, to display the png file, you should convert the local physical path to web path. 如您所知,phpqrcode库将png文件保存在服务器中,保存路径是本地物理路径,要显示png文件,应将本地物理路径转换为Web路径。 For example: if you save all the qrcode png file in D:/web_root/qrcode/image/1.png, ...etc. 例如:如果将所有qrcode png文件保存在D:/web_root/qrcode/image/1.png,... etc。 and your web domain is http://www.example.com/ , you should convert the above local path to web path as http://www.example.com/qrcode/image/1.png , ...etc. 并且您的网站域是http://www.example.com/ ,则应将上述本地路径转换为网站路径,如http://www.example.com/qrcode/image/1.png等等。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM