I have partially sorted a problem I have. I have created an
array ($arr[]=$row['TimeID'] = array("time" => array( $row['HouseName'],$row['Day'],$row['StartTime'], $row['FinishTime'],$hours, $we, $dateSunday, $row['Type'] , $row['Name'], $row['PayrollID']));)This works well. I now want to export this information to a csv.
I get a csv but all the information is in one column not in rows; this is the code I am using to create the rows in the csv - I am puzzled as to how I can get each row horizontally and then automatically go to the next row at the end of the line.
$fhandle = fopen($file, "w");
foreach ($arr as $k => $v)
{
foreach($v as $k1 =>$v1){
foreach($v1 as $k2 =>$v2){
fputcsv($fhandle,split('"',$v2));
}
}
}
Any ideas?
Thanks for your help.
Edited by Jaan, 02 April 2010 - 04:39 AM.
Please use code tags when you are posting your codes!


Sign In
Create Account


Back to top









