<?php  
date_default_timezone_set('Asia/Shanghai');
/*
* 根据二维数组某个字段的值查找数组
*/
function filter_by_value ($array, $index, $value){
if(is_array($array) && count($array)>0)
{
foreach(array_keys($array) as $key){
$temp[$key] = $array[$key][$index];
if ($temp[$key] == $value){
$newarray[$key] = $array[$key];
}
}
}
return $newarray;
}

$arr = array(
0=>array(
'id'=>1,
'name'=>'a'
),
1=>array(
'id'=>2,
'name'=>'b'
),
2=>array(
'id'=>3,
'name'=>'c'
),
3=>array(
'id'=>4,
'name'=>'d'
),
);

$res = filter_by_value($arr,'id',3);
print_r($res);