I work on some unit-tests. My results are big multidimensional arrays. I don't want to compare the whole array, but only a few keys in this "hierachical structure". Here is a snippet of my expected array:
$expected = array(
'john' => array(
'maham' => 4563,
),
'gordon' => array(
'agrar' => array(
'sum' => 7895,
),
),
'invented' => 323,
);
The result array is bigger but there are some entries which are the same as in my expected one. So I want to compare them. If the values are equal.
I tried some array_intersect, diff functions but It seems that they not work on an multidimensionals array.
Is there a maybe a way to use array_walk_recursive on my expected array and get the appropriate key of the result array? Something like a pointer or a reference?