What is the best php method to extract all IDs from a query string and display them in a comma separated list?
I have a function that grabs specific posts from the database and am trying to enter those ID's into a new wp_query loop.
Array (
[0] => stdClass Object (
[ID] => 162
[post_author] => 1
[post_date] => 2011-10-22 09:25:46
[post_date_gmt] => 2011-10-22 14:25:46
[post_content] =>
[post_title] => Paper III
[post_excerpt] =>
[post_status] => publish
[comment_status] => open
[ping_status] => open
[post_password] =>
[post_name] => paper-iii
[to_ping] =>
[pinged] =>
[post_modified] => 2011-12-22 09:22:05
[post_modified_gmt] => 2011-12-22 14:22:05
[post_content_filtered] =>
[post_parent] => 0
[guid] => http:/mysite.org/?post_type=album&p=162
[menu_order] => 0
[post_type] => album
[post_mime_type] =>
[comment_count] => 0
[user_nicename] => matt
)
[1] => stdClass Object (
[ID] => 166
[post_author] => 2
[post_date] => 2011-12-22 11:32:46
[post_date_gmt] => 2011-12-22 16:32:46
[post_content] =>
[post_title] => mtayla's album
[post_excerpt] =>
[post_status] => publish
[comment_status] => open
[ping_status] => closed
[post_password] =>
[post_name] => mtaylas-album
[to_ping] =>
[pinged] =>
[post_modified] => 2011-12-26 20:23:00
[post_modified_gmt] => 2011-12-27 01:23:00
[post_content_filtered] =>
[post_parent] => 0
[guid] => http:/mysite.org/?post_type=album&p=166
[menu_order] => 0
[post_type] => album
[post_mime_type] =>
[comment_count] => 0
[user_nicename] => mtayla
)
[2] => stdClass Object (
[ID] => 308
[post_author] => 2
[post_date] => 2012-01-31 15:04:29
[post_date_gmt] => 2012-01-31 20:04:29
[post_content] =>
[post_title] => another album
[post_excerpt] =>
[post_status] => publish
[comment_status] => open
[ping_status] => open
[post_password] =>
[post_name] => another-album
[to_ping] =>
[pinged] =>
[post_modified] => 2012-01-31 15:04:29
[post_modified_gmt] => 2012-01-31 20:04:29
[post_content_filtered] =>
[post_parent] => 0
[guid] => http:/mysite.org/?post_type=album&p=308
[menu_order] => 0
[post_type] => album
[post_mime_type] =>
[comment_count] => 0
[user_nicename] => mtayla
)
)