Hey there guys.
I am trying to combine two or more arrays based on values that match within those arrays.
Here is an example of the array I am working with:
Code:
[5] => Array
(
[id] => 207
[session_id] => 6589
[conference] => 198
[title] => (206) Studies of Threading Successes in Popular PC Games and Engines
[format] => Tutorial
[type] => 3
[overview] => Half-day tutorial, repeated in morning and after lunch. In this follow-up to 2007's popular Threading Games for Performance tutorial, Paul Lindberg and Brad Werth will present detailed case studies of successful threading practices in modern PC games. Each case study will be bookended by an explanation of the theory and a "what if" discussion of alternative approaches and further improvements. In addition to detail on specific games, major PC engines will be covered -- maybe the one you are planning to use in your next game.
[file_name] => o1/vault/gdc08/slides/S6589i3.ppt
[ftp_url] => ftp://cmpmedia.vo.llnwd.net/o1/vault/gdc08/slides/S6589i3.ppt
[http_url] => http://cmpmedia.vo.llnwd.net/o1/vault/gdc08/slides/S6589i3.ppt
[featured] => 0
[free] => 0
[homepage] =>
[image] =>
[speakers] => Array
(
[0] => Array
(
[id] => 285
[cmpevents_id] => 442854
[link] => https://www.cmpevents.com/GD08/a.asp?option=G&V=3&id=442854
[first_name] => Paul
[last_name] => Lindberg
[job_title] => Senior Software Engineer
[company] => Intel
)
[1] => Array
(
[id] => 254
[cmpevents_id] => 550518
[link] => https://www.cmpevents.com/GD08/a.asp?option=G&V=3&id=550518
[first_name] => Brad
[last_name] => Werth
[job_title] => Senior Software Engineer
[company] => Intel
)
)
[sort_by_speaker] => Paul Lindberg
[sort_by_company] => Intel
[tracks] => Array
(
[0] => Array
(
[id] => 23
[name] => Programming
[conference] => 198
)
)
[tracks_display] => Programming
[type_data] => Array
(
[id] => 3
[name] => Slides
[icon_url] => /vault/images/icon_slideshow.gif
)
[rating] => Array
(
[class] => rating nostar
)
)
[6] => Array
(
[id] => 208
[session_id] => 6589
[conference] => 198
[title] => (206) Studies of Threading Successes in Popular PC Games and Engines
[format] => Tutorial
[type] => 3
[overview] => Half-day tutorial, repeated in morning and after lunch. In this follow-up to 2007's popular Threading Games for Performance tutorial, Paul Lindberg and Brad Werth will present detailed case studies of successful threading practices in modern PC games. Each case study will be bookended by an explanation of the theory and a "what if" discussion of alternative approaches and further improvements. In addition to detail on specific games, major PC engines will be covered -- maybe the one you are planning to use in your next game.
[file_name] => o1/vault/gdc08/slides/S6589i4.ppt
[ftp_url] => ftp://cmpmedia.vo.llnwd.net/o1/vault/gdc08/slides/S6589i4.ppt
[http_url] => http://cmpmedia.vo.llnwd.net/o1/vault/gdc08/slides/S6589i4.ppt
[featured] => 0
[free] => 0
[homepage] =>
[image] =>
[speakers] => Array
(
[0] => Array
(
[id] => 285
[cmpevents_id] => 442854
[link] => https://www.cmpevents.com/GD08/a.asp?option=G&V=3&id=442854
[first_name] => Paul
[last_name] => Lindberg
[job_title] => Senior Software Engineer
[company] => Intel
)
[1] => Array
(
[id] => 254
[cmpevents_id] => 550518
[link] => https://www.cmpevents.com/GD08/a.asp?option=G&V=3&id=550518
[first_name] => Brad
[last_name] => Werth
[job_title] => Senior Software Engineer
[company] => Intel
)
)
[sort_by_speaker] => Paul Lindberg
[sort_by_company] => Intel
[tracks] => Array
(
[0] => Array
(
[id] => 23
[name] => Programming
[conference] => 198
)
)
[tracks_display] => Programming
[type_data] => Array
(
[id] => 3
[name] => Slides
[icon_url] => /vault/images/icon_slideshow.gif
)
[rating] => Array
(
[class] => rating nostar
)
)
Alright, so, here is what needs to happen.
If Array #5 and #6 have the the same session_id and type, I need the file_name, ftp_url, and http_url of Array #6 to be appended to Array #5. All of the values within the arrays are the same minus the file_name, ftp_url, and http_url.
Also, please know that their could be 4-5 matching arrays all with the same session_id and type and they would all need to be merged into *1* entry with their respective file_name, ftp_url, and http_url.
Any ideas on how to do this?
|