【发布时间】:2017-10-24 11:50:15
【问题描述】:
是否可以将 csv 数据导出为两部分:
从下图中,我有两件事需要考虑 1. 夏天 2. 详细信息
我只使用了 2 种类型,是否可以做 2 批(如图所示)..?
如果您有任何替代想法,请提出建议。
例子:
摘要标题
$titleSummery = array('Course Name','Average watched','semi watched','notwached','sudents attempted','sudents notattempted','Total students','Branch','passout');
/*summery data */
详细信息标题
$titleDetail = array('student','passout','branch','percentage watched','student email');
/*Details data */
在这种情况下,我该如何导出数据..?
$output = fopen('php://output', 'w');
fputcsv($output, $title);
foreach($data as $k=>$res){
fputcsv($output,$res);
}
【问题讨论】:
标签: php file csv export-to-csv multiple-tables