I have a PHP array of objects and would like to get all the post\_id values easily. I have looked into things like array\_values and am not really sure what to do with this. Is the best way to just use a for loop and add each post\_id to another array with all the post ids?

Thanks for the help! 

```
[0] => stdClass Object
    (
        [post_id] => 70242
        [image_id] => 70244
        [large_image] => 0
    )

[1] => stdClass Object
    (
        [post_id] => 70327
        [image_id] => 70339
        [large_image] => 1
    )

[2] => stdClass Object
    (
        [post_id] => 70017
        [image_id] => 70212
        [large_image] => 1
    )

```

EDIT:
I am getting this array from a WordPress db call:

```
$q = <<<SQL
    SELECT post_id, image_id, large_image
    FROM $homepage_db
    ORDER BY position;
SQL;

$results = $wpdb->get_results($q);

```

And then `$results` is the array above