I want to create something like the following array
[Schedule_Date_Group] => Array
(
[Schedule_Date] => Array
(
[Friday, September 16, 2011] => Array
(
[Schedule_Item] => Array
(
[nid] => 763
[time] => 1:15 PM
[title] => What a Publisher Does: 5 Reasons Why You Need a...
[event_type] => events
[length] =>
[movie_type] =>
[details] =>
)
[Schedule_Item] => Array
(
[nid] => 763
[time] => 1:15 PM
[title] => What a Publisher Does: 5 Reasons Why You Need a...
[event_type] => events
[length] =>
[movie_type] =>
[details] =>
)
)
)
)
But I have a few issues, first the array seems to be getting created with a preceding # for the first value. Example
[7] => Array
(
[Schedule_Date_Group] => Array
(
And my arrays are not pushing it under the Date Array ([Friday, September 16, 2011] => Array) They are just being added to the end as a normal array. Example
[7] => Array
(
[Schedule_Date_Group] => Array
(
[Schedule_Date] => Array
(
[Friday, September 16, 2011] => Array
(
[Schedule_Item] => Array
(
[nid] => 763
[time] => 1:15 PM
[title] => What a Publisher Does: 5 Reasons Why You Need a...
[event_type] => events
[length] =>
[movie_type] =>
[details] =>
)
)
)
)
)
[8] => Array
(
[Schedule_Item] => Array
(
[nid] => 764
[time] => 1:30 PM
[title] => Navigating the Road to Licensing Music For Your...
[event_type] => events
[length] =>
[movie_type] =>
[details] =>
)
)
How can I fix these two issues. They are again, #'s preceding the Schedule_Date_Group array and the sub arrays being added to the end rather then nested under the date group array.
PHP For the main schedule item and date group part
$xml[] = array("Schedule_Date_Group" => array("Schedule_Date" => array($pretty_date => array("Schedule_Item" => array("nid" => $do['nid'], "time" => $pretty_time, "title" => $title, "event_type" => $do['field_event_type_value'], "length" => $do['field_length_value'], "movie_type" => $do['field_movie_type_value'], "details" => $schedule_details)))));
PHP for the sub menu items
$xml[] = array("Schedule_Item" => array("nid" => $do['nid'], "time" => $pretty_time, "title" => $title, "event_type" => $do['field_event_type_value'], "length" => $do['field_length_value'], "movie_type" => $do['field_movie_type_value'], "details" => $schedule_details));
It is being looped through so there is no way for me to just create a giant array. And if a new "Schedule Date" is set it will create a new [Schedule_Date_Group] => Array
(
[Schedule_Date] => Array
(
[Friday, September 16, 2011] => Array
(
and all the sub content should go under that new one.
So I would end up with
DATE
- Schedule_Item 1
- Schedule_Item 2
- Schedule_Item 3
- Schedule_Item 4
New Date
- Schedule Item 5
- Schedule Item 6
etc...
Any help?