php < 5.1 fix for the advanced search

This commit is contained in:
Ralf Becker 2006-10-27 12:03:37 +00:00
parent 6564cbc99a
commit bcb22e45ef

View File

@ -1462,3 +1462,21 @@ $readonlys['button[vcard]'] = true;
$GLOBALS['egw']->common->egw_footer(); $GLOBALS['egw']->common->egw_footer();
} }
} }
if (!function_exists('array_intersect_key')) // php5.1 function
{
function array_intersect_key($array1,$array2)
{
$intersection = $keys = array();
foreach(func_get_args() as $arr)
{
$keys[] = array_keys((array)$arr);
}
foreach(call_user_func_array('array_intersect',$keys) as $key)
{
$intersection[$key] = $array1[$key];
}
return $intersection;
}
}