This article is a mirror article of machine translation, please click here to jump to the original article.

View: 12784|Reply: 4

PHP generates a QR code example

[Copy link]
Posted on 3/8/2015 11:22:13 PM | | |
There are many ways to generate QR codes in PHP, you can use google's open API, you can use the php QR Code library to generate, this article focuses on using the php QR Code library to generate QR codes.

  1. <?php
  2. # include这两个文件之一:
  3. /*
  4. qrlib.php for full version (also you have to provide all library files
  5. form package plus cache dir)
  6. OR phpqrcode.php for merged version (only one file,
  7. but slower and less accurate code because disabled cache
  8. and quicker masking configured)
  9. */
  10. # 两句话解释:
  11. # 包含qrlib.php的话需要同其它文件放到一起:文件、文件夹。
  12. # phpqrcode.php是合并后版本,只需要包含这个文件,但生成的图片速度慢而且不太准确
  13. # 以下给出两种用法:
  14. # 创建一个二维码文件
  15. QRcode::png('code data text', 'filename.png');
  16. // creates file
  17. # 生成图片到浏览器
  18. QRcode::png('some othertext 1234');
  19. // creates code image and outputs it directly into browser
  20. ?>
Copy code
Code Pack Download:
Tourists, if you want to see the hidden content of this post, pleaseReply





Previous:What are the types of 2D barcodes? What type do we currently use?
Next:About the problem of Chinese garbled characters when using ZXing to scan QR codes
Posted on 9/5/2017 5:03:41 PM |
Thanks for sharing
Posted on 10/8/2017 3:24:15 PM |
Prompt:Authors are banned or removed content is automatically blocked
Posted on 3/21/2018 8:55:52 AM |
louzhuhairen
Posted on 2/27/2019 8:15:43 PM |
This one is also good
https://www.sucaihuo.com/php/247.html
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com