so, is there need of array_adiff()? Best regards Andrey Hristov
----- Original Message ----- From: "Stig Venaas" <[EMAIL PROTECTED]> To: "Brad LaFountain" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Tuesday, August 27, 2002 5:02 PM Subject: Re: [PHP-DEV] array_diff not working with last element different > On Tue, Aug 27, 2002 at 06:39:57AM -0700, Brad LaFountain wrote: > > <? > > $ar = array("b" => 1, "blah" => 1); > > $a1 = array("b" => 1, "blah" => 2); > > var_dump(array_diff($ar, $a1)); > > ?> > > array(0) { > > } > > I guess this may not be clear from documentation. array_diff() works > with values. So it will return all values from first array that are > not in the others. Since the value 1 is present in $a1, all elements > of value 1 are removed from $ar in the returned array. > > Stig > > -- > PHP Development Mailing List <http://www.php.net/> > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php