static function calculateMeteoNav($tabNbHoureMeteo) { $tabMeteo = array(); foreach ($tabNbHoureMeteo as $date => $jourTab) { $tempMax = -40; $tempMin = 40; $meteoBest = "i"; // Iceberg $meteoWorst = "en"; // Ensoleillé foreach ($jourTab as $key => $data) { $temp = $data["temp"]; $meteo = $data["meteo"]; //$precipitation = $data["precipitation"]; $tempMax = $temp > $tempMax ? $temp : $tempMax; $tempMin = $temp < $tempMin ? $temp : $tempMin; $meteoBest = NbHoureMeteo::isMeteoBest($meteoBest, $meteo) ? $meteoBest : $meteo; $meteoWorst = NbHoureMeteo::isMeteoWorst($meteoWorst, $meteo) ? $meteoWorst : $meteo; } $tabMeteo[$date] = array(); $tabMeteo[$date]["tempMax"] = $tempMax; $tabMeteo[$date]["tempMin"] = $tempMin; $tabMeteo[$date]["meteoBest"] = $meteoBest; $tabMeteo[$date]["meteoWorst"] = $meteoWorst; } return $tabMeteo; }