Tuesday, 26 February 2019

Tuesday, 19 February 2019

Array Sorting based on key

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