Welcome Guest, Not a member yet? Register   Sign In
help with calendar library
#1

[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?


Messages In This Thread
help with calendar library - by El Forum - 08-09-2010, 05:22 AM
help with calendar library - by El Forum - 08-09-2010, 05:27 AM
help with calendar library - by El Forum - 08-09-2010, 05:33 AM
help with calendar library - by El Forum - 08-10-2010, 07:38 AM
help with calendar library - by El Forum - 08-10-2010, 09:55 AM
help with calendar library - by El Forum - 08-10-2010, 10:39 AM



Theme © iAndrew 2016 - Forum software by © MyBB