Home > php教程 > PHP源码 > body text

使用Leaps生成二维码

PHP中文网
Release: 2016-05-25 17:08:25
Original
1045 people have browsed it

php代码

/** 
 * 使用phpqrcode生成二维码 
 * 
 * @param string $value 二维码数据 
 * @param string $level 纠错级别:L、M、Q、H 
 * @param int $size 点的大小:1到10,用于手机端4就可以了 
 */ 
function qrcode($value, $level = 'L', $size = 4) { 
      Loader::lib ( 'QRcode.QRcode', false ); 
      return QRcode::png ( $value, false, $level, $size ); 
} 
在页面中使用
echo qrcode('http://www.php.cn');
Copy after login

Related labels:
source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template