I\'m trying to use array_diff like so. Here are my two array outputs:
List 1 Output
Array ([0] => 0022806 )
List 2 Output
Per the documentation, the values of the second array are subtracted from the first one. Or, to put it another way, you start with the first array, and then remove all the values that appear in the second array. That would correctly yield an empty array that you see above
You might want to play around with intersection, that might help you get what you want.
The order of arguments in array_diff() is important
Returns an array containing all the entries from array1 that are not present in any of the other arrays
try;
$diff = array_merge(array_diff($list_1, $list_2), array_diff($list_2, $list_1));
print "DIFF: " . count($diff) ."<br>";
print_r($diff);
From the docs:
Returns an array containing all the entries from array1 that are not present in any of the other arrays.
If you only want to check whether they are the same, you can use $list1 == $list_2