如何生成二维码而不保存二维码图像到文件夹?

我正在使用http://phpqrcode.sourceforge.net/来生成二维码。但是这里有一个问题,就是我生成二维码时,但是二维码会自动保存在$tempDir = "qrcodes/";中,所以我想知道如何生成二维码,但是文件夹中不会保存任何图像?

这是我的代码:

<?php 
            include 'phpqrcode.php';
            include('phpqrcode/qrlib.php');

            // how to save PNG codes to server
            $uuid = md5(uniqid());
            $uuidsha1 = sha1($uuid); 

            $codeContents = $uuidsha1;
            $tempDir = "qrcodes/";
            // we need to generate filename somehow,// with md5 or with database ID used to obtains $codeContents...
            $fileName = ''.md5($codeContents).'.png';

            $pngAbsoluteFilePath = $tempDir.$fileName;
            $urlRelativeFilePath = $tempDir.$fileName;

            // generating
            QRcode::png($codeContents,$pngAbsoluteFilePath,QR_eclEVEL_H,8,1,false);

            // displaying
            echo '<img src="'.$urlRelativeFilePath.'" />';

        ?>
clorchid 回答:如何生成二维码而不保存二维码图像到文件夹?

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3099363.html

大家都在问