Home  >  Article  >  php教程  >  使用Leaps生成二维码

使用Leaps生成二维码

PHP中文网
PHP中文网Original
2016-05-25 17:08:251046browse

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');

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