Bonjour,
je tente de récuperer un flux rss dans un fla
Malheureusement celui ce me renvoie les balises html !
J'ai essayé stip tag mais sans succes.
(dans mon code la ligne est commenté)
_avez vous une astuce ? (à part la décommenter ;))
<?php
//php 4 version
// Link to RSS feed. Change this to the full location of your feed.
$feedUrl = "http://www.lemonde.fr/rss/sequence/0,2-3210,1-0,0.xml";
// Return the url of the feed to the swf
echo "&feedUrl=".$feedUrl;
// Date Format
$dateFormat = 'jS F y';
// This loads the entire XML feed
$rssstring = file_get_contents($feedUrl);
// Return the title of the feed
preg_match_all("#<title>(.*?)</title>#s",$rssstring,$mainTitle);
//$mainTitle = "Your Title Here"; // Use this line instead of the line above if you want to set a different title than the RSS title
echo "&mainTitle=".$mainTitle[1][0];
// Parse each item in the RSS feed
preg_match_all("#<item>(.*?)</item>#s",$rssstring,$items);
$n=count($items[0]);
// Return the total number of items
echo "&totalItems=".$n;
for($i=0;$i<$n;$i++)
{
$rsstemp= $items[0][$i];
preg_match_all("#<title>(.*?)</title>#s",$rsstemp,$titles);
$title= $titles[1][0];
preg_match_all("#<link>(.*?)</link>#s",$rsstemp,$links);
$link= $links[1][0];
preg_match_all("#<description>(.*?)</description>#s",$rsstemp,$descriptions);
$description= $descriptions[1][0];
//$description = str_replace("<![CDATA[", "", $description);
//$description = str_replace("]]>", "", $description);
// Strip html tags. Use the line below if you want to strip the html tags (including images) from your description.
//$description = strip_tags($description);