<?php
$array = array(array(1,2,3),
array(1,2,3),
array(1,2,3));
function createExcel($array){
header ( "Content-type:application/vnd.ms-excel" ); // 指定类型
header ( "Content-Disposition:attachment;filename=csat.xls" ); // 指定文件名
echo '<table border=1>';
foreach($array as $k=>$v){
echo '<tr>';
foreach($v as $val){
echo '<td>中文</td>';
}
echo '</tr>';
}
echo '</table>';
}
createExcel($array);
?>
$array = array(array(1,2,3),
array(1,2,3),
array(1,2,3));
function createExcel($array){
header ( "Content-type:application/vnd.ms-excel" ); // 指定类型
header ( "Content-Disposition:attachment;filename=csat.xls" ); // 指定文件名
echo '<table border=1>';
foreach($array as $k=>$v){
echo '<tr>';
foreach($v as $val){
echo '<td>中文</td>';
}
echo '</tr>';
}
echo '</table>';
}
createExcel($array);
?>