public static function array_remove_assoc_recursive(&$array1, $array2)
    {
        foreach ($array2 as $key => $value) {
            if (!array_key_exists($key, $array1)) {
                return $array1;
            } elseif (is_array($value)) {
                self::array_remove_assoc_recursive($array1[$key], $value);
                if (0 === count($array1[$key])) {
                    unset($array1[$key]);
                }
            } else {
                unset($array1[$key]);
            }
        }
    }
public static function array_remove_assoc_recursive(&$array1, $array2)
    {
        foreach ($array2 as $key => $value) {
            if (!array_key_exists($key, $array1)) {
                return $array1;
            } elseif (is_array($value)) {
                self::array_remove_assoc_recursive($array1[$key], $value);
                if (0 === count($array1[$key])) {
                    unset($array1[$key]);
                }
            } else {
                unset($array1[$key]);
            }
        }
    }
public static function array_remove_assoc_recursive ( & $ array1 , $ array2 ) { foreach ( $ array2 as $ key => $ value ) { if ( ! array_key_exists ( $ key , $ array1 ) ) { return $ array1 ; } elseif ( is_array ( $ value ) ) { self :: array_remove_assoc_recursive ( $ array1 [ $ key ] , $ value ) ; if ( 0 === count ( $ array1 [ $ key ] ) ) { unset ( $ array1 [ $ key ] ) ; } } else { unset ( $ array1 [ $ key ] ) ; } } }
Remove array2 from array1
@param  array $array1
@param  array $array2
@return array
Remove array2 from array1