<?php
require 'Spreadsheet/Excel/Writer.php';
$workbook = new Spreadsheet_Excel_Writer('multi-worksheet-demo.xls'); // 初始化类
//$workbook->send('multi-worksheet-demo.xls'); // 发送 Excel 文件名供下载
$n=$_POST['N'];
$h=$_POST91;'H'];
$t=$_POST['T'];
$c=$_POST['C'];
$worksheet =& $workbook->addWorksheet('sheet-1'); // 加入一个工作表 sheet-1
$data = array(
array($n, $h, $t,$c),
array("中文测试", "中文测试", "中文测试","中文测试")
);
for ($row = 0; $row < count($data); $row ++) {
for ($col = 0; $col < count($data[0]); $col ++) {
$worksheet->writeString($row, $col, iconv("UTF-8","GB2312",$data[$row][$col])); // 写入数据
}
}
$workbook->close(); // 完成下载
?>
require 'Spreadsheet/Excel/Writer.php';
$workbook = new Spreadsheet_Excel_Writer('multi-worksheet-demo.xls'); // 初始化类
//$workbook->send('multi-worksheet-demo.xls'); // 发送 Excel 文件名供下载
$n=$_POST['N'];
$h=$_POST91;'H'];
$t=$_POST['T'];
$c=$_POST['C'];
$worksheet =& $workbook->addWorksheet('sheet-1'); // 加入一个工作表 sheet-1
$data = array(
array($n, $h, $t,$c),
array("中文测试", "中文测试", "中文测试","中文测试")
);
for ($row = 0; $row < count($data); $row ++) {
for ($col = 0; $col < count($data[0]); $col ++) {
$worksheet->writeString($row, $col, iconv("UTF-8","GB2312",$data[$row][$col])); // 写入数据
}
}
$workbook->close(); // 完成下载
?>