|
|
|
| Подскажите как вытащить данные из этого xml
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<rss version="2.0" xmlns:yweather="http://xml.weather.yahoo.com/ns/rss/1.0" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#">
<channel>
<title>Yahoo! Weather - Moscow, RS</title>
<link>http://us.rd.yahoo.com/dailynews/rss/weather/Moscow__RS/*http://weather.yahoo.com/forecast/RSXX0063_f.html</link>
<description>Yahoo! Weather for Moscow, RS</description>
<language>en-us</language>
<lastBuildDate>Wed, 17 Jun 2009 1:00 pm MSD</lastBuildDate>
<ttl>60</ttl>
<yweather:location city="Moscow" region="" country="RS"/>
<yweather:units temperature="F" distance="mi" pressure="in" speed="mph"/>
<yweather:wind chill="62" direction="160" speed="4" />
<yweather:atmosphere humidity="93" visibility="2.49" pressure="29.15" rising="0" />
<yweather:astronomy sunrise="4:45 am" sunset="10:15 pm"/>
<image>
<title>Yahoo! Weather</title>
<width>142</width>
<height>18</height>
<link>http://weather.yahoo.com</link>
<url>http://l.yimg.com/a/i/us/nws/th/main_142b.gif</url>
</image>
<item>
<title>Conditions for Moscow, RS at 1:00 pm MSD</title>
<geo:lat>55.97</geo:lat>
<geo:long>37.42</geo:long>
<link>http://us.rd.yahoo.com/dailynews/rss/weather/Moscow__RS/*http://weather.yahoo.com/forecast/RSXX0063_f.html</link>
<pubDate>Wed, 17 Jun 2009 1:00 pm MSD</pubDate>
<yweather:condition text="Rain Shower" code="11" temp="62" date="Wed, 17 Jun 2009 1:00 pm MSD" />
<description><![CDATA[
<img src="http://l.yimg.com/a/i/us/we/52/11.gif"/><br />
<b>Current Conditions:</b><br />
Rain Shower, 62 F<BR />
<BR /><b>Forecast:</b><BR />
Wed - Clouds Early/Clearing Late. High: 65 Low: 49<br />
Thu - Partly Cloudy. High: 67 Low: 48<br />
<br />
<a href="http://us.rd.yahoo.com/dailynews/rss/weather/Moscow__RS/*http://weather.yahoo.com/forecast/RSXX0063_f.html">Full Forecast at Yahoo! Weather</a><BR/>
(provided by The Weather Channel)<br/>
]]></description>
<yweather:forecast day="Wed" date="17 Jun 2009" low="49" high="65" text="Clouds Early/Clearing Late" code="29" />
<yweather:forecast day="Thu" date="18 Jun 2009" low="48" high="67" text="Partly Cloudy" code="30" />
<guid isPermaLink="false">RSXX0063_2009_06_17_13_00_MSD</guid>
</item>
</channel>
</rss>
<img src="http://l.yimg.com/a/i/us/we/52/11.gif"/>
<yweather:condition text="Rain Shower" code="11" temp="62" date="Wed, 17 Jun 2009 1:00 pm MSD" />
Картинку выдрал $img=$rss->channel->image->url
Дальше пишу echo "<img scr=.$img>"; а картинки нет пустой квадратик | |
|
|
|
|
|
|
|
для: damlex
(18.06.2009 в 15:30)
| | Прежде чем подставлять значение переменной $img, попробуйте вывести на экран ее значение
| |
|
|
|
|
|
|
|
для: mihdan
(18.06.2009 в 15:58)
| | идет ссылка http://l.yimg.com/a/i/us/we/52/11.gif | |
|
|
|
|
|
|
|
для: damlex
(18.06.2009 в 15:30)
| | >Дальше пишу echo "<img scr=.$img>"; а картинки нет пустой квадратик
точка зачем? | |
|
|
|
|
 938 байт |
|
|
для: Trianon
(18.06.2009 в 23:32)
| | точку удалил теперь там белый квадрат и красной точкой | |
|
|
|
|
|
|
|
для: DAmlex
(19.06.2009 в 10:33)
| | может стоит посмотреть сгенерированный html-код?
Я кстати, спросил "Зачем" и ответа не получил. | |
|
|
|