Re: Array_diff problems

From: Date: Fri, 27 Apr 2012 20:13:39 +0000
Subject: Re: Array_diff problems
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-317720@lists.php.net to get a copy of this message
"Rick Dwyer" <rpdwyer@earthlink.net> wrote in message news:0C0E6CC9-089D-4938-8B50-C9E12DFB37CF@earthlink.net... Hello all. I have two arrays and when compared against each other via array_diff, I do not get any output: $myarray1 = Array ( [0] => Array ( [id] => 1 [Funding_Type] => Federal [Amount] => 10 [Frequency_Description] => Total [Other_Funding] => ) [1] => Array ( [id] => 2 [Funding_Type] => Trust [Amount] => 20 [Frequency_Description] => Per Year [Other_Funding] => ) [2] => Array ( [id] => 3 [Funding_Type] => Other Funding [Amount] => 30 [Frequency_Description] => Other [Other_Funding] => some )) $myarray2 = Array ( [0] => Array ( [id] => 1 [Funding_Type] => Federal [Amount] => 10 [Frequency_Description] => Total [Other_Funding] => ) [1] => Array ( [id] => 2 [Funding_Type] => Trust [Amount] => 20 [Frequency_Description] => Per Year [Other_Funding] => ) [2] => Array ( [id] => 3 [Funding_Type] => Other Funding [Amount] => 50 [Frequency_Description] => Other [Other_Funding] => none )) $arraydifferences = (array_diff($myarray1,$myarray2)); I need $arraydifferences to record the differences between the two. Any help is appreciated. Thanks, --Rick Are these arrays nested in an array? In that case the manual says you have to do the compare differently.

« previous php.general (#317720) next »