Return to Snippet

Revision: 5033
at February 6, 2008 11:02 by razel


Initial Code
if (!function_exists('array_intersect_key'))
{
    function array_intersect_key ($isec, $arr2)
    {
        $argc = func_num_args();
        
        for ($i = 1; !empty($isec) && $i < $argc; $i++)
        {
             $arr = func_get_arg($i);
            
             foreach ($isec as $k => $v)
                 if (!isset($arr[$k]))
                     unset($isec[$k]);
        }
       
        return $isec;
    }
}

Initial URL

                                

Initial Description
Fallback Function for versions earlier then php5

Initial Title
array_intersect_key() for php4

Initial Tags
php, array

Initial Language
PHP