For a little background information, I am trying to sync two calendars (one of them is the google calendar)
I am using the two APIs to get all the event information from these two calendars and putting them into their own arrays. So that leaves me with:
GoogleEventArray
OtherEventArray
In the long run I would like to do a two-way sync between the two arrays. However, for now to keep it simple I just want to keep OtherEventArray as the Master, and GoogleEventArray as the slave.
I am not looking to just delete the entire google calendar each time I run the script and update it from the OtherEventArray because this script will be on a cron job running every minute or so to keep the google calendar up to date. I just need to check the arrays for changes or needed additions.
So I just need some ideas for the best way to sync these two arrays?
EDIT
Maybe a better way would be to find whats different between these two arrays and add it to a third array so I can just use this to save the changes to the google calendar.
Because if I just combine the two arrays into one I still would have to save all this data that hasnt been changed to the google calendar therefore causing unnecessary work load.
Also here are my two arrays with data in them so you can get an idea of things that can change and I need to detect those changes in the title, or date, or description
have you tried
array_combine.You can do array addition also: