Tak wygląda kod xml
http://brzanek.webd.pl/prognoza/tiempo/wyn...a/choszczno.xml
Kod pliku php
<?php include ("db.php"); { $report = simplexml_load_file('http://brzanek.webd.pl/prognoza/tiempo/wyniki/godzinowa/choszczno.xml'); foreach ($report->location->day as $day) { echo 'tempmin: '.$day->tempmin['value'].'°C tempmax: '.$day->tempmax['value'].'°C rain: '.$day->rain['value'].' l/m2 <img src="http://brzanek.webd.pl/prognoza/tiempo/iconos/tiempo-weather/galeria5/'.$day->symbol['value'].'.png" width="50px"><br />'; foreach ($day->hour as $hour) { //foreach ($report->location->day->hour as $hour) { echo 'godz: '.$hour['value'].' godz: '.$hour->temp['value'].'°C wind: '.$hour->wind['value'].'km/h rain: '.$hour->rain['value'].' l/m2 <img src="http://brzanek.webd.pl/prognoza/tiempo/iconos/tiempo-weather/galeria5/'.$hour->symbol['value'].'.png" width="25px"><br />'; $wtime = $hour['value']; $tempmin = $hour->temp['value']; $tempmax = $hour->temp['value']; $symbol = $hour->symbol['value']; $speed = $hour->wind['value']; $gusts = $hour->wind-gusts['value']; $kierunek = $hour->wind['dir']; $rain = $hour->rain['value']; $wilgotnosc = $hour->humidity['value']; $cisnienie = $hour->pressure['value']; (wtime, tempmin, tempmax, symbol, speed, gusts, kierunek, rain, wilgotnosc, cisnienie) VALUES( '$wtime', '$tempmin', '$tempmax', '$symbol', '$speed', '$gusts', '$kierunek', '$rain', '$wilgotnosc', '$cisnienie')"); $wi++; } } } ?>
Wszystko działa aż do momentu napotkania myślnika w tym
$gusts = $hour->wind-gusts['value'];
Czy muszę to jakoś w specjalny sposób wyświetlić?