Home  >  Article  >  Backend Development  >  How to generate php dynamic QR code

How to generate php dynamic QR code

(*-*)浩
(*-*)浩Original
2019-10-11 09:42:473583browse

We can use phpqrcode, a ready-made class file and PHP QR code generation class library, to easily generate QR codes. The QR codes are dynamic and there is no need to generate pictures. The QR codes can be customized. Size, gap, jump address, etc.

How to generate php dynamic QR code

phpqrcode generates a simple example of dynamic QR code

Parameter settings: (recommended learning :PHP video tutorial)

include_once 'phpqrcode.php'; 
$data = 'https://www.php.cn/'; 
// 纠错级别:L、M、Q、H 
$level = 'L'; 
// 点的大小:1到10,用于手机端4就可以了 
$size = 7; 
// 下面注释了把二维码图片保存到本地的代码,如果要保存图片,用$fileName替换第二个参数false 
//$path = "images/"; 
// 生成的文件名 
//$fileName = $path.$size.'.png'; 
QRcode::png($data, false, $level, $size);

Picture:

How to generate php dynamic QR code

The above is the detailed content of How to generate php dynamic QR code. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn