array_diff check value, not keys..

"Nick Eby" <[EMAIL PROTECTED]> a écrit dans le message de news:
> example:
> $arr1 = array("color" => "red", "flavor" => "cherry");
> $arr2 = array("color" => "cherry", "flavor" => "red");
> print_r(array_diff($arr1, $arr2));
> those 2 arrays are different, but array_diff doesn't know it since it
> doesn't compare values at particular keys, just values in general.  i want
> function that knows that those 2 arrays are different; that the values for
> both color and flavor changed, and gives me back an array that looks
> like $arr2.  although it would take about five minutes to write such a
> function, i'm wondering, does one already exist and i just can't find it
> the manual?  thanks
> /nick

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to