[eluser]jochemvn[/eluser]
My question is more about arrays then about the calendar library. I have 1 calendar, but I want to add data to my calendar from multiple models.
Each model returns an array. How dow I merge these arrays?
Code:
Array 1:
Array
(
[15] => Appointment with Mom
[21] => Watching television
)
Array 2:
Array
(
[12] => Paul's birthday
[21] => Jenny's birthday
)
How do I merge these 2 array's so they look like this:
Code:
Array 3:
Array
(
[12] => Paul's birthday
[15] => Appointment with Mom
[21] => Watching television
[21] => Jenny's birthday
)
Using array_merge resets the numbers, which correspond with the day's of a month, so that's no good. I could probably use a foreach to add the elements of the second array to the first, but I'm wondering if there's a single command to get this working.
Any suggestions?