I'm trying to generate QR codes on my website. All they have to do is have a URL in them, which a variable on my site will provide. What would be the easiest way to do this?
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
I have been using google qrcode api for sometime, but I didn't quite like this because it requires me to be on the Internet to access the generated image.
I did a little comand-line research and found out that linux has a command line tool
qrencode
for generating qr-codes.I wrote this little script. And the good part is that the generated image is less than 1KB in size. Well the supplied data is simply a url.
Then in the html I load the image:
You just need to have installed it. [most imaging apps on linux would have installed it under the hood without you realizing.