I'm trying to compare 2 arrays and report the differences between both arrays.
Doing :
print_r(array_diff($new,$old)) only shows the differences one way, so I have to run it again as print_r(array_diff($old,$new)) to see the differences the other way.
<?
$new = array (
0=>"newALL",
1=>"TEST,2",
2=>"TEST,3",
3=>"TEST,4");
$old = array (
0=>"newA,40",
1=>"newA,41",
2=>"TEST,2",
3=>"TEST,3",
4=>"TEST,4",
5=>"newit,2",
6=>"newit,3");
print_r(array_diff($new,$old));
print_r(array_diff($old,$new));
?>
is there a better way to do it ? how do I get both sets of results into one new array ? 🙂
Thanks