i have 2 php Arrays and want to compare elements. examples:
$Array_A[0]["field"]=10; $Array_B[0]["field"]=10;
$Array_A[1]["field"]=20; $Array_B[1]["field"]=30;
$Array_A[2]["field"]=30; $Array_B[2]["field"]=40;
$Array_A[3]["field"]=40;
Array_Difference() should return 20
$Array_A[0]["field"]=10; $Array_B[0]["field"]=10;
$Array_A[1]["field"]=20; $Array_B[1]["field"]=20;
$Array_A[2]["field"]=30; $Array_B[2]["field"]=40;
$Array_A[3]["field"]=40;
Array_Difference() should return 30
For Case that there are more than 1 Difference i would Loop a Function which is finding and return the first found Difference.
What is "best-pratice" to do this Task?