forzatio Posted July 5, 2007 Share Posted July 5, 2007 Hello, I have a RSS feed with an enclosure tag in it, I'm trying to parse the picture out of the enclosure. I use magpierss, though I'm not getting the output of the picture displayed. Php parsing code: <?php require_once 'rss_fetch.inc'; $url = 'http://feed.com/feed.rss'; $rss = fetch_rss($url); foreach ($rss->items as $item ) { $description = strip_tags($item[description], '<b>'); $url = $item[link]; $title = strip_tags($item[title], '<b>'); $enclosure = $item['enclosure'][0]['url']; echo "$title<br><br>$description<br><br>$enclosure"; } ?> the XML's enclosure tag <enclosure url="http://website.com/picture.jpg" width="120" height="90" type="image/jpeg" length="10000" /> I have the latest magpierss which should support the enclosure tag now. Hope to get some good watch on the code, thanks. Link to comment https://forums.phpfreaks.com/topic/58515-rss/ Share on other sites More sharing options...
forzatio Posted July 5, 2007 Author Share Posted July 5, 2007 bump please, I just don't get the picture output from the xml's enclosure tag. Link to comment https://forums.phpfreaks.com/topic/58515-rss/#findComment-290540 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.