Any reason you are using strtotime
on distances?
This should work:
usort($return, function($a, $b){
return $a['Distance'] - $b['Distance'];
});
Edit:
Ok I see what the problem is, as written in the doc:
Returning non-integer values from the comparison function, such as float, will result in an internal cast to integer of the callback's return value. So values such as 0.99 and 0.1 will both be cast to an integer value of 0, which will compare such values as equal.
So the solution is to make sure the comparison function always returns an integer:
usort($return, function($a, $b){
$t1 = $a['Distance'];
$t2 = $b['Distance'];
if ($t1 == $t2) return 0;
return $t1 < $t2 ? -1 : 1;
});