How to use ORDER BY of a data that does not come from db? ex:
$query = $mysql->query("SELECT * FROM db_aux ;");
while($row = $query->fetch_array())
{
$url = "https://maps.googleapis.com/maps/api/distancematrix/json?origins=";
$url .= $row['cep_local']."&destinations=".$row['cep_user'];
$url .= "&language=pt&mode=car&key=AIzaSyDL6_dJ-Mbi_03_g6lHhWibxY22Z2UeYZQ";
$json = file_get_contents($url);
$json_data = json_decode($json, true);
}
I want to sort by this data that comes from query json
, DESC
$json_data['rows'][0]['elements'][0]['distance']['text'];