Ada banyak cara untuk menghasilkan kode QR di PHP, Anda dapat menggunakan API terbuka google, Anda dapat menggunakan perpustakaan Kode QR php untuk menghasilkan, artikel ini berfokus pada penggunaan perpustakaan Kode QR php untuk menghasilkan kode QR.
- <?php
- # include这两个文件之一:
- /*
- qrlib.php for full version (also you have to provide all library files
- form package plus cache dir)
- OR phpqrcode.php for merged version (only one file,
- but slower and less accurate code because disabled cache
- and quicker masking configured)
- */
- # 两句话解释:
- # 包含qrlib.php的话需要同其它文件放到一起:文件、文件夹。
- # phpqrcode.php是合并后版本,只需要包含这个文件,但生成的图片速度慢而且不太准确
- # 以下给出两种用法:
- # 创建一个二维码文件
- QRcode::png('code data text', 'filename.png');
- // creates file
- # 生成图片到浏览器
- QRcode::png('some othertext 1234');
- // creates code image and outputs it directly into browser
- ?>
Salin kode Unduh Paket Kode:Wisatawan, jika Anda ingin melihat konten tersembunyi dari posting ini, silakan Jawab
|