$xml = simplexml_load_file('http://www.google.com/ig/api?weather=dubrovnik');
$information = $xml->xpath("/xml_api_reply/weather/forecast_information");
$current = $xml->xpath("/xml_api_reply/weather/current_conditions");
$forecast_list = $xml->xpath("/xml_api_reply/weather/forecast_conditions");
?>
Weather in Dubrovnik
|
Forecast
|
foreach ($forecast_list as $forecast) : ?>
$low = ceil(($forecast->low['data'] - 32)/1.8);
$high = ceil(($forecast->high['data'] - 32)/1.8);
?>
| = $forecast->day_of_week['data']; ?> |
|
= $low ?>° C - = $high ?>° C,
= $forecast->condition['data'] ?>
|
endforeach ?>