Getting an array from one property of an associative array best practice
I think array_map is what you are looking for:

php &gt; $aa = array (array ("id" =&gt; 1, "name" =&gt; 'what'), array('id' =&gt; 2));
php &gt; function id($i) { return $i['id'];};
php &gt; print_r(array_map ('id', $aa));
Array
(
    [0] =&gt; 1
    [1] =&gt; 2
)