I try to implement a recursive array_diff, but I sill do not find a 100% working function.
I have two arrays:
Array
(
[11] => Array
(
[id] => 24077
[a] => 11
)
[22] => Array
(
[id] => 24078
[a] => 22
)
)
Array
(
[11] => Array
(
[id] => 24077
[a] => 11
)
[22] => Array
(
[id] => 24078
[a] => 22
)
[27] => Array
(
[id] => 24080
[a] => 27
)
)
I tested both Function mentioned here: recursive array_diff()?
I call the functions via:
$diff = arrayRecursiveDiff($array1, $array2);
$diff = array_diff_recursive($array1, $array2);
I always get an empty array back. There's one element deleted in the first array, so I expect a result that shows me that one element is missing (maybe an array item with empty content?).
If I change the arrays in the function call:
$diff = arrayRecursiveDiff($array2, $array1);
$diff = array_diff_recursive($array2, $array1);
I'll get the new one [27]... but I need the way described above.
Do you have any ideas? How would you try to find a way to solve this problem?