从多维数组的列创建简单数组

if I have a multidimensional array containing data from certain mysql table, such as:

Array ( [0] => Array ( [0] => 5255071 [id] => 5255071 [1] => 2013-02-28 20:40:48 [sent] => 2013-02-28 20:40:48 ) [1] => Array ( [0] => 5253758 [id] => 5253758 [1] => 2010-11-16 12:56:39 [sent] => 2010-11-16 12:56:39 ) [2] => Array ( [0] => 5253517 [id] => 5253517 [1] => 2010-11-16 12:43:57 [sent] => 2010-11-16 12:43:57 ) [3] => Array ( [0] => 5252348 [id] => 5252348 [1] => 2010-11-16 11:19:35 [sent] => 2010-11-16 11:19:35 ) [4] => Array ( [0] => 5252343 [id] => 5252343 [1] => 2010-11-16 11:19:01 [sent] => 2010-11-16 11:19:01 ) [5] => Array ( [0] => 5252254 [id] => 5252254 [1] => 2010-11-16 11:11:26 [sent] => 2010-11-16 11:11:26 ) [6] => Array ( [0] => 5251390 [id] => 5251390 [1] => 2010-11-16 09:16:57 [sent] => 2010-11-16 09:16:57 ) [7] => Array ( [0] => 5249381 [id] => 5249381 [1] => 2010-11-16 03:01:32 [sent] => 2010-11-16 03:01:32 ) [8] => Array ( [0] => 5249086 [id] => 5249086 [1] => 2010-11-16 02:47:30 [sent] => 2010-11-16 02:47:30 ) [9] => Array ( [0] => 5247987 [id] => 5247987 [1] => 2010-11-16 01:59:34 [sent] => 2010-11-16 01:59:34 ) [10] => Array ( [0] => 5247325 [id] => 5247325 [1] => 2010-11-16 01:33:12 [sent] => 2010-11-16 01:33:12 ) ) 

Is there a way to create a new single array containing only the 'id' values? this is:

array(5255071, 5253758, 5253517, 5252348, ...)

The idea is to avoid using a foreach loop. Thanks in advance.

You could use array_map() for this:

function extractId ($array) { return $array['id']; }
$targetArray = array_map($sourceArray, "extractId");
$output = array_values($array['id']);

see: array_values