5
I have a array
of the kind
array1(array(1,2,3,4,5), array(2,3,4,5,6));
and another of the kind
array2(1,2,3,4,6);
I need to compare array1 with array2 and pick the difference between them, but array1 is a set of arrays and I don’t know how to do this.
I used the function array_diff($array1, $array2);
that when used with simple arrays as is the case with array2, returns the difference between them in an array, it would be great if it worked with each array of array1 compared to array2, but I read about the function and nothing talks about comparing these types of arrays.
you then need to generate an array of differences between array1 positions?
– novic
Exact, each position of the array1 be compared with the array2.
– Lucas Araujo
what difference you want to specify better, you want to know how many elements there are within one array and how many there are in the other?
– Vinicius De Jesus
vc wants to compare the array2 with the array1 or with the first array within the array1?
– Vinicius De Jesus
The difference of the elements, for example the first position of array1 has 5 and array2 does not, while the second position also has 5 and array2 does not. basically I want to learn how to compare each position of 1 with 2. the two is fixed, what complicates me is that array1 is an array with several other arrays.
– Lucas Araujo