I have two arrays that I am trying to find the differences / similarities between the two.
Here is the arrays:
[781]=>
array(7) {
["Pri_ID"]=>
string(3) "781"
["Type"]=>
string(7) "Athlete"
["EntryDate"]=>
string(10) "2013-04-15"
["Status"]=>
string(6) "Active"
}
[782]=>
array(7) {
["Pri_ID"]=>
string(3) "782"
["EntryDate"]=>
string(10) "2013-04-15"
["Status"]=>
string(7) "Removed"
}
here is the second array:
[780]=>
array(7) {
["Pri_ID"]=>
string(3) "781"
["EntryDate"]=>
string(10) "2013-04-15"
["Status"]=>
string(7) "Removed"
}
[782]=>
array(7) {
["Pri_ID"]=>
string(3) "782"
["EntryDate"]=>
string(10) "2013-04-15"
["Status"]=>
string(7) "Active"
}
Notice that the key in the second array (780 ) does not exist in the first array. Also notice that the 'status' of array number two (id 782 )is now 'active' but was originally in a status of removed.
The overall goal of this project is to compare the two arrays, located any differences, then placed these differences in either and array or a string and email the differences. Here is what I have tried so far:
$Deleted[] = array_diff_assoc($myarrayOld, $myarrayNew);
$Added[] = array_diff_assoc($myarrayNew, $myarrayOld);
This will pick up the changes between the array keys, but not the statuskeys of the array.