I have a set of old scores and a set of new scores. Each set of scores has five elements to it. What I need to do is see if any of the five elements from one set of scores differs by more than one from the same element in the second set of scores.
So, I have two arrays:
Array1 ( [55] => 2 [56] => 3 [57] => 4 [58] => 5 [59] => 2 )
Array2 ( [55] => 1 [56] => 2 [57] => 3 [58] => 4 [59] => 5 )
I need to compare array 1 with array 2 to determine if the difference between any one element is more than one. If variance is more than one for any element, $variance = 1. If it's not, $variance = 2.
In this case, element 59 has a difference of 3, so $variance should be 2.
Can anyone come up with a function that will compare these arrays to determine if $variance is 1 or 2?
Thanks.