Home > Backend Development > PHP Tutorial > 怎样实现将下列两个文件放入同一excel的不要sheet里面

怎样实现将下列两个文件放入同一excel的不要sheet里面

WBOY
Release: 2016-06-13 11:55:59
Original
890 people have browsed it

怎样实现将下列两个文件放入同一excel的不用sheet里面

怎样实现将下列两个文件放入同一excel   mod.xls的不用sheet,sheet1和sheet2里面
第一个php

header("Content-type: application/vnd.ms-excel");
header('Content-Disposition: attachment; filename="mod.xls"');

include('comm.php');
mysql_select_db('test');

$sql = "select * from module6";
$query = mysql_query($sql);
echo"第六单元(1-6)\t\n";
        echo "\n";
echo "用户名\t   第1题\t  第2题\t  第3题\t  第4题\t  第5题\t  第6题\t\n";
while($row = mysql_fetch_array($query)){
echo "\n";
echo $row['username']."\t".$row['strategy1']."\t".$row['strategy2']."\t".$row['strategy3']."\t".$row['strategy4']."\t".$row['tellwho']."\t".$row['diag']."\t"."\n";
}

?>






header("Content-type: application/vnd.ms-excel");
header('Content-Disposition: attachment; filename="modxls"');

include('comm.php');
mysql_select_db('test');

$sql = "select * from module5";
$query = mysql_query($sql);
echo"第五单元(1-3)\t\n";
        echo "\n";
echo "用户名\t 第1题\t   第2题\t  第3题\t \n";
while($row = mysql_fetch_array($query)){
echo "\n";
echo $row['username']."\t".$row['select11']."\t".$row['mailfile']."\t".$row['idea']."\t"."\n";
}

?>
------解决方案--------------------
请用 phpexcel 类

既然你不能从多个工作簿中同时导出 csv 文件,那么怎么能奢望将 csv 文件导入到多个工作簿呢?

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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template