I am trying to figure out how to write a tie-break function. The following entries are related for one reason or another, therefore, to break the tie, we sort each result, and then look at each line. The tie is broken at the first point, there is a difference.
In the example below, on the first pass, $ result [c] is eliminated, but a and b are still connected. Then in the second pass, a is eliminated, because it is greater than b. Thus, the result: b, a, c
$result[a] = array(1, 3, 4, 5);
$result[b] = array(1, 2, 3, 7);
$result[c] = array(2, 3, 3, 5);
And to make it even more difficult, I will not always have the same number of results for comparison. It can be more than 2.
I really hope this makes sense.
source
share