请多看手册。。。。。
官方虽然没有提供函数,但是手册实例有提供
function multidimensional_search($parents, $searched) {
if (empty($searched) || empty($parents)) {
return false;
}
foreach ($parents as $key => $value) {
$exists = true;
foreach ($searched as $skey => $svalue) {
$exists = ($exists && IsSet($parents[$key][$skey]) && $parents[$key][$skey] == $svalue);
}
if($exists){ return $key; }
}
return false;
}
$parents = array();
$parents[] = array('date'=>1320883200, 'uid'=>3);
$parents[] = array('date'=>1320883200, 'uid'=>5);
$parents[] = array('date'=>1318204800, 'uid'=>5);
echo multidimensional_search($parents, array('date'=>1320883200, 'uid'=>5)); // 1
?>