{‚current_observation‘}->{‚display_location‘}->{‚full‘}; $temp_c = $parsed_json->{‚current_observation‘}->{‚temp_c‘}; $relative_humidity = $parsed_json->{‚current_observation‘}->{‚relative_humidity‘}; $wind_direction = $parsed_json->{‚current_observation‘}->{‚wind_dir‘}; $weather = $parsed_json->{‚current_observation‘}->{‚weather‘}; $wind_speed = $parsed_json->{‚current_observation‘}->{‚wind_kph‘}.“km/h“; // forecast $forecast = $parsed_json->{‚forecast‘}->{‚txt_forecast‘}->{‚forecastday‘}; $simpleforecast = $parsed_json->{‚forecast‘}->{’simpleforecast‘}->{‚forecastday‘}; /* DayNumber is 0 = today, 1 = tomorrow, 2 = day after tomorrow… max 6 */ function getDay($DayNumber,$forecast,$simpleforecast) { global $forecast, $simpleforecast; $result = null; $day = $forecast[$DayNumber]; $result[‚dayofweek‘] = $day->{‚title‘}; $result[‚text‘] = $day->{‚fcttext_metric‘}; $day_array = explode(‚.‘,$result[‚text‘]); $result[‚forecast_weather‘] = $simpleforecast[$DayNumber]->{‚conditions‘}; // „conditions“: „Teils Wolkig“, $result[‚icon‘] = $simpleforecast[$DayNumber]->{‚icon_url‘}; // „icon_url“: „http://icons-ak.wxug.com/i/c/k/partlycloudy.gif“, $result[‚forecast_high‘] = „Höchsttemperatur: „.$simpleforecast[$DayNumber]->{‚high‘}->{‚celsius‘}.“°C“; $result[‚forecast_low‘] = „Tiefsttemperatur: „.$simpleforecast[$DayNumber]->{‚low‘}->{‚celsius‘}.“°C“; $result[‚forecast_humidity‘] = „Luftfeuchtigkeit: „.$simpleforecast[$DayNumber]->{‚avehumidity‘}.“%“; $result[‚forecast_wind‘] = „Windgeschwindigkeit: „.$simpleforecast[$DayNumber]->{‚avewind‘}->{‚kph‘}.“km/h“; $result[‚forecast_winddirection‘] = $simpleforecast[$DayNumber]->{‚avewind‘}->{‚dir‘}; // Südwest $result[‚forecast_rainrisk‘] = „Regenwahrscheinlichkeit: „.$simpleforecast[$DayNumber]->{‚pop‘}.“%“; // probability of precipitation = regenwahrscheinlichkeit return $result; } function printDay($day,$title) { return „

$title