lng = $lng; } function get($loc) { $XmlStr = file_get_contents($this->basUrl.urlencode($loc).'&hl='.$this->lng); $Xml = simplexml_load_string(utf8_encode($XmlStr)); $W = $Xml->weather; $this->Data['info']['city'] = (string)$W->forecast_information->city['data']; $this->Data['info']['today'] = strtotime((string)$W->forecast_information->forecast_date['data']); $this->Data['info']['time'] = strtotime((string)$W->forecast_information->current_date_time['data']); if(!$this->Data['info']['city']) { $this->Error = '"'.$loc.'" not found'; return false; } // today $w = array(); foreach($W->current_conditions->children() as $k => $v) { $w[$k] = (string)$v['data']; } $this->Data['current'] = $w; $this->Data['current']['updated'] = $this->Data['info']['time']; // forecast $w = array(); $i = 0; foreach($W->forecast_conditions as $k1 => $v1) { $t = $this->Data['info']['today']+($i*86400); foreach($v1->children() as $k2 => $v2) { $w[$t][$k2] = (string)$v2['data']; } $i++; } $this->Data['forecast'] = $w; return $this->Data; } } if(!$_GET['loc']) { $_GET['loc'] = "Bolzano"; } if(!$_GET['lng']) { $_GET['lng'] = "de"; } $Gw = new GoogleWeather; $Gw->setLng($_GET['lng']); $Gw->get($_GET['loc']); ?> Meteo

1. Search

2. Meteo

Error) : ?>

Error:

Find City:

Now [08.12.2025 20:13]:

      Temperatur: °C      
Data['forecast'] as $k => $v) : if($k==$Gw->Data['info']['today']) continue; ?>

[08.12.2025]:

   Temperatur max: °C    min: °C