Return to Snippet

Revision: 5032
at February 6, 2008 11:01 by razel


Initial Code
if (!function_exists('array_diff_key'))
{
    function array_diff_key()
    {
        $arrs = func_get_args();
        $result = array_shift($arrs);
        foreach ($arrs as $array) {
            foreach ($result as $key => $v) {
                if (array_key_exists($key, $array)) {
                    unset($result[$key]);
                }
            }
        }
        return $result;
   }
}

Initial URL

                                

Initial Description
Fallback Function for versions earlier then php5

Initial Title
array_diff_key() for PHP4

Initial Tags
php, array

Initial Language
PHP