foreach ($data as $key => $row) {
$distance[$key] = $row['distance'];
}
array_multisort($distance, SORT_ASC, $data);
code to enable sorting for json feed/array.
source :
https://stackoverflow.com/questions/5305594/sort-a-multidimensional-array-using-array-multisort/5305641#5305641