Jump to content

RSS <enclosure.. tag, not parsed with php parser


forzatio

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.