我正在尝试从查询创建 CSV,并且我需要数据符合以下格式:
header("Content-type: text/csv");
header("Content-Disposition: attachment; filename=file.csv");
header("Pragma: no-cache");
header("Expires: 0");
$array = array(
array("data11", "data12", "data13"),
array("data21", "data22", "data23"),
array("data31", "data32", "data23"));
outputCSV($array);
我习惯于像这样聚合数据:
while ($row = mysql_fetch_array($result)){
$values[] = $row['value'];
}
如何传递outputCSV
适当的数组?