作者:乔山办公网日期:
返回目录:excel表格制作
你现在发的这个百代度码是对的额!
现在知有什么问题呢?道
你好,Java框架Bootstrap jQuery SpringMVC Hibernate 安全内权限容
有兴趣,+qiu裙--> 378 437 335
PHP 有专门做excel的类,比较流行的是phpexcel。官方网址:抄http://phpexcel.codeplex.com/
可以到他们网站上下载,毕竟官方的是百最稳定的,也是最放心的嘛。下载地址:http://phpexcel.codeplex.com/releases/view/45412
网站是英文的不过国内也有很多中文的教程,可以在网度上搜一下。
下载了之后,里面有很多例子,问如果要求的不是很复杂,前一两个例子看完后就可以实现答你要的效果了。
header('Content-type: text/html; charset=utf-8');
header("Content-type:application/vnd.ms-excel;charset=UTF-8");
header("Content-Disposition:filename=test.xls");
//有上面这些头信息 下面输出你要得数据就可以了
echo $a."\t";echo $b."\t\n";
//这里zhidao的\t是下一版个数据,\t\n是换行
//自己试试把
如果不是要写程序 ,只权是想取得数据库中数据的excel phpmyadmin导出文件有excel格式的
不要用 \t 制表符。
用<table><tr><td></td></tr></table>
<?php
header("Content-type:application/vnd.ms-excel"); //excel头信息
header("Content-Disposition:attachment;filename=test_data.xls");
?>
<table class="table" border="1">
<thead>
<tr>
<th>编号: </th>
<th>门店 </th>
<th>手机号码 </th>
</tr>
</thead>
<tbody>
<?php
//数据库7a64e59b9ee7ad94362查询
$dosql->Execute("select * from link_log order by id desc");
$i=$dosql->GetTotalRow();
while($result=$dosql->GetArray()){
$host=$result['host']; //门店
$mobile=$result['mobile']; //手机号码
?>
<td ><?php echo $i;?></td>
<td ><?php echo $host;?></td>
<td ><?php echo $mobile;?></td>
</tr>
<?php
$i--;
}
?>
</tbody>
</table>