1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
   | <?php  
 
require_once "magpierss/rss_fetch.inc"; 
$source = array(); 
 
$source[0] = "http://www.lemonde.fr/rss/sequence/0,2-3214,1-0,0.xml"; 
$source[1] = "http://www.lemonde.fr/rss/sequence/0,2-651865,1-0,0.xml"; 
$source[2] = "http://www.lemonde.fr/rss/sequence/0,2-3260,1-0,0.xml"; 
 
if ($source){ 
 
for ($i=0; $i<=6; $i++){ 
 
$rss = fetch_rss($source[$i]); 
 
if (is_array($rss->items)) 
 
    { 
    $liste = array_slice($rss->items, 0, 3); 
 
$tab = array(); 
 
    foreach ($liste as $item ) { 
 
array_push($tab,$item[pubdate],$item[title],$item[description]); 
 
} 
print_r($tab); 
    }  
} 
} 
?> | 
Partager