|
Posted by VooDoo on 10/23/07 11:37
Hi,
i am trying to put field from this page in a table,
http://xoap.weather.com/weather/local/FRXX0153?cc=*&dayf=10&prod=xoap&unit=m&par=1050532020&key=133aa3f76734eadf
i can get the correct data for the current day, but not for the forecast
days <dayf> :
<dayf>
<lsup>10/22/07 3:19 PM Local Time</lsup>
- <day d="0" t="Monday" dt="Oct 22">
<hi>N/A</hi>
<low>-1</low>
<sunr>8:02 AM</sunr>
<suns>6:41 PM</suns>
- <part p="d">
<icon>44</icon>
<t>N/A</t>
- <wind>
<s>N/A</s>
<gust>N/A</gust>
<d>N/A</d>
<t>N/A</t>
</wind>
<bt>N/A</bt>
<ppcp>0</ppcp>
<hmid>N/A</hmid>
</part>
- <part p="n">
<icon>31</icon>
<t>Clear</t>
- <wind>
<s>8</s>
<gust>N/A</gust>
<d>360</d>
<t>N</t>
</wind>
<bt>Clear</bt>
<ppcp>0</ppcp>
<hmid>76</hmid>
</part>
</day>
+ <day d="1" t="Tuesday" dt="Oct 23">
......
</day>
....
-<dayf>
f
my code:
$parser = xml_parser_create( );
xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
xml_parse_into_struct($parser,$xml,$values,$index);
xml_parser_free($parser);
$city = htmlspecialchars($values[$index['dnam'][0]]['value']);
$unit_temp = $values[$index['ut'][0]]['value'];
$unit_speed = $values[$index['us'][0]]['value'];
I can not get the forecast days (1 to 9) in a correct array..
Do i need to parse again??
Thanks for your help
VooDoo
Navigation:
[Reply to this message]
|