Re: Array differences

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

 



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

[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