php 生成二维码

前段时间搞微信手机web 支付 看见文件中有这么一段生成二维码代码

/** *利用google api生成二维码图片
	 * $content:二维码内容参数
	 * $size:生成二维码的尺寸,宽度和高度的值
	 * $lev:可选参数,纠错等级
	 * $margin:生成的二维码离边框的距离
	 */
	function create_erweima($content, $size = '200', $lev = 'L', $margin= '0') {
		$content = urlencode($content);
		$image = '<img src="http://chart.apis.google.com/chart?chs='.$size.'x'.$size.'&cht=qr&chld='.$lev.'|'.$margin.'&chl='.$content.'"  widht="'.$size.'" height="'.$size.'" />';
		return $image;
	}

 

posted @ 2017-08-28 18:02  王先生架构  阅读(193)  评论(0编辑  收藏  举报
失独者之家