I have a social networking app that uses a codeigniter REST api and one of our features is a feed of newly created content and up until now this has only consisted of user statuses, but now id like to add a variety of different content into the feed( updates,photos, user interactions, etc.)
I have functions in place that grab each type of content individually and places them in array of objects. So there is an array of object of statuses, an array of objects for photos and etc. Each object in each of these arrays of objects has a timestamp field and I would like to merge all of these arrays of objects into a single array of objects sorted by the timestamp field all the objects share, but im not sure how to go about doing this?