简体   繁体   中英

I've got a qr code output with an exact value but I don't know how to store the generated image. How can I store a qr-code image?

In the code I have a value string as a test and I am getting an output once I scan qr-code. I would like to store that qr-code image in a folder.

include 'phpqrcode/qrlib.php';
$value = "test";
if($count > 0)
{                 
     QRcode::png('code data text', 'filename.png'); // creates file 
     $result = QRcode::png($values); // creates code image and outputs it 
                                                directly into browser
}

You have 3 options,

  1. Just store the coded data text in a file or database
  2. Store the qrcode binary in a database ( QRcode::text($codeContents) )
  3. Store the qrcode to a file like @DarkBee said QRcode::png($codeContents, $pngAbsoluteFilePath);

Good luck!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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