Hi,
I am looping through an array, and for each value, I need to insert another array containing a few items. The below code inserts the array fine:
foreach($events as $Key => $val):
$schedule[$Key] = array(
array('event_id' => 'test',
'start_date_time' => 'test',
'end_date_time'=>'test'), ));
endforeach;
And this gives me something like the below:
Array
(
[1287039600] =>
[1287043200] =>
[1287050400] =>
[1287054000] =>
[1287054900] =>
[1287057600] =>
[1287061200] =>
[1287064800] => Array
(
[0] => Array
(
[event_id] => 'test'
[start_date_time] => 'test'
[end_date_time] => 'test'
)
)
[1287068400] =>
[1287072000] =>
[1287075600] =>
)
My problem is that I need to insert more than one array for each key, and if i do this, I overwrite the previous entrance.
I think I need to increment the [0] => Array value shown above.
Can anyone advise on how this can be done?
Regards, Ben.