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 33 34 35 36
|
$i = 0;
$xml = simplexml_load_file('flux1.xml') ;
foreach($xml->channel->item as $item)
{
$tableau[$i][1] = utf8_decode($item->title);
$tableau[$i][0] = utf8_decode($item->pubDate);
$tableau[$i][2] = utf8_decode($item->description);
$tableau[$i][3] = "source n°1";
$tableau[$i][4] = utf8_decode($item->link);
$i++;
}
$xml = simplexml_load_file('flux2.xml') ;
foreach($xml->channel->item as $item)
{
$tableau[$i][1] = utf8_decode($item->title);
$tableau[$i][0] = utf8_decode($item->pubDate);
$tableau[$i][2] = utf8_decode($item->description);
$tableau[$i][4] = utf8_decode($item->link);
$tableau[$i][3] = "source n°2";
$i++;
}
/* affichage du tableau */
for($k=0;$k<$i;$k++)
{
echo "<h3><a href='".$tableau[$k][4]."'>".$tableau[$k][1]."</a></h3>";
$daterss = utf8_decode($tableau[$k][0]);
echo '<p>Le '.date("d F Y",strtotime($daterss)).', ';
echo "par ".$tableau[$k][3]."</p>";
echo "<p>".$tableau[$k][2]."</p>";
echo "<p class='description'></p>";
} |
Partager