I have three array values using nested loop. Now i want to export the array values to csv(excel). The code is
How to export $date[],$project-id,$hours[],$desc to csv
Thanks in advance
Haan
Code:
for($j=0;$j<count($TimeEntriesList);$j++){
for($n=0;$n<count($TimeEntriesList[$j]['time-entry']);$n++){
$datee[] = $TimeEntriesList[$j]['time-entry'][$n]['date'];
$person_id[] = $TimeEntriesList[$j]['time-entry'][$n]['person-id'];
$project_id[] = $TimeEntriesList[$j]['time-entry'][$n]['project-id'];
$desc[] = $TimeEntriesList[$j]['time-entry'][$n]['description'];
$hours[] = $TimeEntriesList[$j]['time-entry'][$n]['hours'];
unset($TimeEntriesList[$j]['time-entry'][$n]['todo-item-id']);
//$csv_hdr .= $datee[].",".$person_id[].",".$hours[].",".$desc[]."\n";
}
}
Thanks in advance
Haan
Comment