Re: Array differences

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Apr 14, 2010 at 12:03 PM, Nathan Rixham <nrixham@xxxxxxxxx> wrote:
> Ashley Sheridan wrote:
>> On Tue, 2010-04-13 at 23:01 -0600, Ashley M. Kirchner wrote:
>>>
>>> However what I really want is a two-way comparison.  I want elements that
>>> don't exist in either to be returned:
>>>
>>
>>
>> I don't see any problems with doing it that way.
>
> By some freak chance I made an array diff class about 2 weeks ago which
> covers what you need. attached :)
>
> usage:
>
> $diff = new ArrayDiff( $old , $new );
> $diff->l; // deleted items
> $diff->r; // inserted items
> $diff->u; // unchanged items
>
> The script is optimised for huge arrays, thus it's slower for small
> arrays than the usual array_diff but with large arrays it's quicker.
>
> Regards
>
> Nathan
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

nice one :) i'll put it in a work-preperation folder for
htmlMicroscope then, one of these days :)

-- 
---------------------------------
Greetings from Rene7705,

I have made some free open source webcomponents designed
and written by me available through:
http://code.google.com/u/rene7705/ , or
http://mediabeez.ws (latest dev versions, currently offline)

Personal info about me is available through http://www.facebook.com/rene7705
---------------------------------

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux