I have the next foreach:
foreach(json_decode($result[$k], "true") as $result) {
fputcsv($fp, $result);
}
and if I put a var_dump of that result it will return a list of arrays like:
["Id"]=> string(7) "1"
["Name"]=> string(29) "Name"
["Description"]=> string(19) "Description"
["Address"]=> string(27) "Address"
["Schedule"]=> array(7) {
[0]=> array(2) {
["startHour"]=> string(5) "00:00"
["stopHour"]=> string(5) "23:59"
}
[1]=> array(2) {
["startHour"]=> string(5) "00:00"
["stopHour"]=> string(5) "23:59"
}
[2]=> array(2) {
["startHour"]=> string(5) "00:00"
["stopHour"]=> string(5) "23:59"
}
. . .
}
If I put fputcsv($fp, $result) in that foreach loop, everything works good until Schedule. The line from csv looks like:
1, Name, Description, Address, Array.
But, what I want instead of "Array" I want something like
00:00-23:59.
Like:
1, Name, Description, Address, 00:00-23:59, 00:00-23:59, 00:00-23:59
(for each day of the week). Can anyone help me with this? Thank you!
