之前用插件phoexcel写过批量导入数据,现在用到了批量导出,就记录一下,这次批量导出没用插件,是写出一个表格,直接输出
//$teacherList 是从数据库查出来的二维数组 $execlname是要导出的文件名
if(is_array($teacherList)){
foreach($teacherList as $k=>$val){
$strTable .=
;
$strTable .=
.$val[username].\;
$strTable .=
.$val[school].\;
$strTable .=
.$val[ el].\;
$strTable .=
.$val[email].\;
$strTable .=
.$val[ eacher_name].\;
$strTable .=
.$val[create_time].\;
$strTable .=
.$val[status].\;
$strTable .=
;
}
//释放$teacherList
unset($teacherList);
}
$strTable .=\;