Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/278.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在PHP中显示来自rss提要的图像?_Php_Rss - Fatal编程技术网

如何在PHP中显示来自rss提要的图像?

如何在PHP中显示来自rss提要的图像?,php,rss,Php,Rss,我试图在PHP文件中显示来自rss提要的图像 php文件非常简单,没有太多内容 rss提要也来自天空新闻 我得到的php文件将提取我需要的所有信息并显示它们,但我不完全确定如何显示图像 这是我的php代码: <?php $rss = simplexml_load_file('http://www.skysports.com/rss/0,20514,11959,00.xml'); echo '<h1>'. $rss->channel->title . '</h

我试图在PHP文件中显示来自rss提要的图像

php文件非常简单,没有太多内容

rss提要也来自天空新闻

我得到的php文件将提取我需要的所有信息并显示它们,但我不完全确定如何显示图像

这是我的php代码:

<?php
$rss = simplexml_load_file('http://www.skysports.com/rss/0,20514,11959,00.xml');

echo '<h1>'. $rss->channel->title . '</h1>';

foreach ($rss->channel->item as $item) {
   echo '<h2><a href="'. $item->link .'">' . $item->title . "</a></h2>";
   echo "<p>" . $item->pubDate . "</p>";
   echo "<p>" . $item->description . "</p>";
} 
?>
channel->title';
foreach($rss->channel->item as$item){
回声';
回显“”$item->pubDate。”

”; 回显“”$item->description。”

”; } ?>
这是xml rss提要的结构:

<?xml version="1.0" encoding="iso-8859-1" ?>






        <?xml-stylesheet title="XSL_formatting" type="text/xsl" href="http://www.skysports.com/styles/rss-render/0,26674,,00.xsl"?>         
         <rss version="2.0">
            <channel>

                    <title>Sky Sports | Football News</title>
                 <link>http://www.skysports.com</link>

                <description>Europa League News</description>
                 <language>en-gb</language>
                <lastBuildDate>Wed, 27 Mar 2013 18:20:18 GMT</lastBuildDate>
                <copyright>Copyright 2013, BSKYB. All Rights Reserved.</copyright>                      
                <category>Football</category>
                <image>
                    <title>Sky Sports</title>
                    <url>http://www.skysports.com/Images/skysports/site/ss-logo-07.gif</url>
                    <link>http://www.skysports.com</link>                       
                </image>
                <ttl>120</ttl>                              


            <item><title><![CDATA[Cisse eyes glory]]></title><description><![CDATA[Papiss Cisse is confident that Newcastle's season can finish in glory.]]></description><link>http://www1.skysports.com/football/news/11959/8601723/</link><guid isPermaLink="false">11959_8601723</guid><pubDate>Wed, 27 Mar 2013 18:12:36 GMT</pubDate><category>News Story</category><enclosure type="image/jpg" url="http://img.skysports.com/13/02/128x67/Newcastle-v-Metalist-Kharkiv-Papiss-Cisse_2900940.jpg" length="123456" /></item>

            <item><title><![CDATA[Chelsea clash moved to Moscow]]></title><description><![CDATA[UEFA has confirmed that Chelsea's Europa League quarter-final second-leg with Rubin Kazan has been moved to the Luzhniki Stadium in Moscow.]]></description><link>http://www1.skysports.com/football/news/11959/8580924/</link><guid isPermaLink="false">11959_8580924</guid><pubDate>Thu, 21 Mar 2013 10:43:18 GMT</pubDate><category>News Story</category><enclosure type="image/jpg" url="http://img.skysports.com/13/03/128x67/Rubin-Kazan-v-Levante-Jos-Rondon-Sergio-Balle_2915002.jpg" length="123456" /></item>

            <item><title><![CDATA[UEFA opens Inter 'abuse' case]]></title><description><![CDATA[UEFA has announced that a disciplinary case is to be opened against Inter Milan, following reports of fans racially abusing Tottenham players during last Thursday's Europa League game at the San Siro.]]></description><link>http://www1.skysports.com/football/news/11959/8575656/</link><guid isPermaLink="false">11959_8575656</guid><pubDate>Mon, 18 Mar 2013 12:26:33 GMT</pubDate><category>News Story</category><enclosure type="image/jpg" url="http://img.skysports.com/13/03/128x67/Inter-Milan-v-Tottenham-Emmanuel-Adebayor_2915019.jpg" length="123456" /></item>

            <item><title><![CDATA[Gallas wants racism reaction]]></title><description><![CDATA[Tottenham defender William Gallas says walking off the pitch is an understandable reaction to racist abuse and has called on UEFA to respond after chants marred Thursday's game with Inter Milan.]]></description><link>http://www1.skysports.com/football/news/11959/8569919/</link><guid isPermaLink="false">11959_8569919</guid><pubDate>Sat, 16 Mar 2013 11:09:25 GMT</pubDate><category>News Story</category><enclosure type="image/jpg" url="http://img.skysports.com/12/08/128x67/William-Gallas-Tottenham-vs-Valencia_2811170.jpg" length="123456" /></item>

            <item><title><![CDATA[Spurs want tough UEFA stance]]></title><description><![CDATA[Tottenham Hotspur have told Sky Sports they want UEFA to 'make a stand' against racism after their players were abused at Inter Milan on Thursday.]]></description><link>http://www1.skysports.com/football/news/11959/8567989/</link><guid isPermaLink="false">11959_8567989</guid><pubDate>Fri, 15 Mar 2013 13:45:03 GMT</pubDate><category>News Story</category><enclosure type="image/jpg" url="http://img.skysports.com/13/03/128x67/Inter-Milan-v-Tottenham-Jake-Livermore-Antoni_2915000.jpg" length="123456" /></item>

            <item><title><![CDATA[Pardew: Perfect Europa draw]]></title><description><![CDATA[Alan Pardew was delighted as Newcastle were drawn to face Benfica in the quarter-finals of this season's Europa League.]]></description><link>http://www1.skysports.com/football/news/11959/8567905/</link><guid isPermaLink="false">11959_8567905</guid><pubDate>Fri, 15 Mar 2013 13:18:54 GMT</pubDate><category>News Story</category><enclosure type="image/jpg" url="http://img.skysports.com/13/03/128x67/Alan-Pardew-Beard_2910689.jpg" length="123456" /></item>

            <item><title><![CDATA[Bernstein slams Spurs abuse]]></title><description><![CDATA[Football Association chairman David Bernstein has condemned the racist abuse directed towards some Tottenham players in their Europa League game with Inter Milan on Thursday night.]]></description><link>http://www1.skysports.com/football/news/11959/8567723/</link><guid isPermaLink="false">11959_8567723</guid><pubDate>Fri, 15 Mar 2013 12:33:42 GMT</pubDate><category>News Story</category><enclosure type="image/jpg" url="http://img.skysports.com/12/09/128x67/Bernstein_2827663.jpg" length="123456" /></item>

            <item><title><![CDATA[English trio are kept apart]]></title><description><![CDATA[The three Premier League clubs have been kept apart in the Europa League quarter-final draw.]]></description><link>http://www1.skysports.com/football/news/11959/8567594/</link><guid isPermaLink="false">11959_8567594</guid><pubDate>Fri, 15 Mar 2013 11:58:29 GMT</pubDate><category>News Story</category><enclosure type="image/jpg" url="http://img.skysports.com/12/12/128x67/trophy_2871143.jpg" length="123456" /></item>

            <item><title><![CDATA[UEFA waits on Inter decision]]></title><description><![CDATA[UEFA has confirmed they do not expect to make a decision on Friday over whether to open a case against Inter Milan after some of their fans racially abused Tottenham players.]]></description><link>http://www1.skysports.com/football/news/11959/8567161/</link><guid isPermaLink="false">11959_8567161</guid><pubDate>Fri, 15 Mar 2013 09:55:55 GMT</pubDate><category>News Story</category><enclosure type="image/jpg" url="http://img.skysports.com/13/03/128x67/Inter-Milan-v-Tottenham-Emmanuel-Adebayor_2915019.jpg" length="123456" /></item>

            <item><title><![CDATA[Pardew: Europa glory possible]]></title><description><![CDATA[Alan Pardew believes Newcastle United are capable of winning the Europa League after making their way into the quarter-finals.]]></description><link>http://www1.skysports.com/football/news/11959/8566927/</link><guid isPermaLink="false">11959_8566927</guid><pubDate>Fri, 15 Mar 2013 08:24:22 GMT</pubDate><category>News Story</category><enclosure type="image/jpg" url="http://img.skysports.com/13/03/128x67/Alan_2915255.jpg" length="123456" /></item>

            <item><title><![CDATA[Benitez: Torres back on track]]></title><description><![CDATA[Chelsea interim manager Rafael Benitez believes Fernando Torres has fresh confidence, despite his penalty miss in the Europa League victory over Steaua Bucharest.]]></description><link>http://www1.skysports.com/football/news/11959/8566349/</link><guid isPermaLink="false">11959_8566349</guid><pubDate>Fri, 15 Mar 2013 00:06:25 GMT</pubDate><category>News Story</category><enclosure type="image/jpg" url="http://img.skysports.com/13/03/128x67/benitez_2915142.jpg" length="123456" /></item>

            <item><title><![CDATA[Cech content with 'big win']]></title><description><![CDATA[Chelsea goalkeeper Petr Cech felt his side were always capable of seeing off Steaua Bucharest in the UEFA Europa League to advance to the quarter-finals but was relieved to get the job done.]]></description><link>http://www1.skysports.com/football/news/11959/8566291/</link><guid isPermaLink="false">11959_8566291</guid><pubDate>Thu, 14 Mar 2013 23:15:00 GMT</pubDate><category>News Story</category><enclosure type="image/jpg" url="http://img.skysports.com/13/02/128x67/Cech1_2904805.jpg" length="123456" /></item>

            <item><title><![CDATA[Stramaccioni proud of Inter]]></title><description><![CDATA[Inter Milan head coach Andrea Stramaccioni hailed his side's monumental effort as they very nearly pulled off a shock triumph against Tottenham in the UEFA Europa League.]]></description><link>http://www1.skysports.com/football/news/11959/8566278/</link><guid isPermaLink="false">11959_8566278</guid><pubDate>Thu, 14 Mar 2013 23:01:16 GMT</pubDate><category>News Story</category><enclosure type="image/jpg" url="http://img.skysports.com/13/03/128x67/Inter-Milan-v-Tottenham-Andrea-Stramaccioni_2915006.jpg" length="123456" /></item>

            <item><title><![CDATA[Pardew salutes super Cisse]]></title><description><![CDATA[Alan Pardew saluted more last-gasp heroics from Papiss Cisse after his dramatic lone goal against Anzhi Makhachkala sent Newcastle through to the Europa League quarter-finals.]]></description><link>http://www1.skysports.com/football/news/11959/8566265/</link><guid isPermaLink="false">11959_8566265</guid><pubDate>Thu, 14 Mar 2013 22:51:34 GMT</pubDate><category>News Story</category><enclosure type="image/jpg" url="http://img.skysports.com/13/03/128x67/Alan_2915255.jpg" length="123456" /></item>

            <item><title><![CDATA[Lazio too strong for Stuttgart]]></title><description><![CDATA[Libor Kozak scored twice in the opening 10 minutes and completed a hat-trick late on as Lazio turned on the style behind closed doors to reach the Europa League quarter-finals.]]></description><link>http://www.skysports.com/football/match_report/0,19764,11065_3602531,00.html</link><guid isPermaLink="false">11959_8566244</guid><pubDate>Thu, 14 Mar 2013 22:38:58 GMT</pubDate><category>Report</category><enclosure type="image/jpg" url="http://img.skysports.com/13/03/128x67/Lazio-v-Stuttgart-Libor-Kozak-2_2915077.jpg" length="123456" /></item>

            <item><title><![CDATA[AVB: UEFA will act on chants]]></title><description><![CDATA[Andre Villas-Boas expects UEFA to act after Inter Milan fans appeared to racially abuse Tottenham players as they fought back to reach the UEFA Europa League quarter-finals.]]></description><link>http://www1.skysports.com/football/news/11959/8566242/</link><guid isPermaLink="false">11959_8566242</guid><pubDate>Thu, 14 Mar 2013 22:37:49 GMT</pubDate><category>News Story</category><enclosure type="image/jpg" url="http://img.skysports.com/13/03/128x67/avb2_2915141.jpg" length="123456" /></item>

            <item><title><![CDATA[Fenerbahce sneak past Plzen]]></title><description><![CDATA[Substitute Salih Ucan was the hero as Fenerbahce did enough to squeeze into the Europa League quarter-finals with a home draw against Viktoria Plzen.]]></description><link>http://www.skysports.com/football/match_report/0,19764,11065_3602528,00.html</link><guid isPermaLink="false">11959_8566227</guid><pubDate>Thu, 14 Mar 2013 22:25:04 GMT</pubDate><category>Report</category><enclosure type="image/jpg" url="http://img.skysports.com/13/02/128x67/Vladimir-Darida_2900876.jpg" length="123456" /></item>

            <item><title><![CDATA[Benfica ease past Bordeaux]]></title><description><![CDATA[Benfica eased into the quarter-finals of the Europa League as they proved too strong for Bordeaux in the south of France.]]></description><link>http://www.skysports.com/football/match_report/0,19764,11065_3602529,00.html</link><guid isPermaLink="false">11959_8566219</guid><pubDate>Thu, 14 Mar 2013 22:21:16 GMT</pubDate><category>Report</category><enclosure type="image/jpg" url="http://img.skysports.com/11/04/128x67/Jardelcelebrates_2590756.jpg" length="123456" /></item>

            <item><title><![CDATA[Cisse stuns Anzhi to win it]]></title><description><![CDATA[Papiss Cisse headed Newcastle into the quarter-finals of the Europa League with a stoppage-time winner against 10-man Anzhi Makhachkala.]]></description><link>http://www.skysports.com/football/match_report/0,19764,11065_3602530,00.html</link><guid isPermaLink="false">11959_8566188</guid><pubDate>Thu, 14 Mar 2013 22:02:58 GMT</pubDate><category>Report</category><enclosure type="image/jpg" url="http://img.skysports.com/13/03/128x67/Newcastle-v-Anzhi-Makhachkala-Papiss-Cisse-St_2915107.jpg" length="123456" /></item>

            </channel>
        </rss>

天空体育|足球新闻
http://www.skysports.com
欧罗巴联赛新闻
英国英语
2013年3月27日星期三18:20:18 GMT
版权所有2013,英国天空广播公司。保留所有权利。
足球
天空体育
http://www.skysports.com/Images/skysports/site/ss-logo-07.gif
http://www.skysports.com                       
120
http://www1.skysports.com/football/news/11959/8580924/11959_8580924Thu,2013年3月21日10:43:18 GMTNews报道
http://www1.skysports.com/football/news/11959/8569919/11959_8569919Sat,2013年3月16日11:09:25 GMTNews报道
http://www1.skysports.com/football/news/11959/8567989/11959_8567989Fri,2013年3月15日13:45:03 GMTNews报道
http://www1.skysports.com/football/news/11959/8566278/11959_8566278Thu,2013年3月14日23:01:16 GMTNews报道
http://www1.skysports.com/football/news/11959/8566265/11959_8566265Thu,2013年3月14日22:51:34 GMTNews报道
http://www.skysports.com/football/match_report/0,1976411065_3602531,00.html11959_8566244Thu,2013年3月14日22:38:58 GMT报告
http://www1.skysports.com/football/news/11959/8566242/11959_8566242Thu,2013年3月14日22:37:49 GMTNews报道
http://www.skysports.com/football/match_report/0,1976411065_3602528,00.html11959_8566227Thu,2013年3月14日22:25:04 GMT报告
http://www.skysports.com/football/match_report/0,1976411065_3602529,00.html11959_8566219Thu,2013年3月14日22:21:16 GMT报告
http://www.skysports.com/football/match_report/0,1976411065_3602530,00.html11959_8566188Thu,2013年3月14日22:02:58 GMT报告
有人能帮我吗

谢谢

echo“附件['url'][0]。“\”>”;