php 导入导出excel:php导出excel
程序员文章站
2022-05-14 20:55:45
...
/**
* @param string $filname //输出的文件名
* @param string $type //编码类型
* @param string $array //excel的标题
* @param string $data //需要的数据data
**/
function exportExcel($filname, $type = 'utf-8', $array, $data) {
if (empty ($data)) {
echo "";
exit;
}
$filname = iconv("utf-8", "gb2312", $filname);
header("Content-type:application/vnd.ms-excel;");
header("Content-Disposition:attachment;filename=$filname.xls");
echo "";
echo '
';
exit;
}
本文链接http://www.cxybl.com/html/wlbc/Php/20130326/37395.html
* @param string $filname //输出的文件名
* @param string $type //编码类型
* @param string $array //excel的标题
* @param string $data //需要的数据data
**/
function exportExcel($filname, $type = 'utf-8', $array, $data) {
if (empty ($data)) {
echo "";
exit;
}
$filname = iconv("utf-8", "gb2312", $filname);
header("Content-type:application/vnd.ms-excel;");
header("Content-Disposition:attachment;filename=$filname.xls");
echo "";
echo '
$val | ";
' . $v . ' | ';
' . $val . ' | ';
exit;
}
本文链接http://www.cxybl.com/html/wlbc/Php/20130326/37395.html
下一篇: PHP相关文章索引