1 Star 1 Fork 0

凉宫长门/moefm-html5-project

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
qr.php 858 Bytes
一键复制 编辑 原始数据 按行查看 历史
ccloli 提交于 2014-07-23 14:42 . push current version
<?php
header("Content-type:image/png");
$width=180;
$height=180;
$data=$_GET['data'];
echo qrcode($width,$height,$data);
function qrcode($width,$height,$string){
$post_data=array();
$post_data['cht']='qr';
$post_data['chs']=$width."x".$height;
$post_data['chl']=$string;
$post_data['choe']="UTF-8";
$url="http://chart.apis.google.com/chart";
$data_Array=array();
foreach($post_data as $key=>$value){
$data_Array[]=$key.'='.$value;
}
$data=implode("&",$data_Array);
$ch=curl_init();
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POSTFIELDS,$data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result=curl_exec($ch);
//echo "<img src =\"data:image/png;base64,".base64_encode($result)."\" >"; 注意,不写header的写法
return $result;
}
?>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
HTML
1
https://gitee.com/nagato/moefm-html5-project.git
[email protected]:nagato/moefm-html5-project.git
nagato
moefm-html5-project
moefm-html5-project
master

搜索帮助