|
|
|
|
<?php
# Configuration
$fichier_xml = "adresse_flux_rss"; # Placez ici l'adresse du flux
$nombre_limite = 20; # Nombre maximum d'éléments à afficher
# Affichage du Flux
$raw = file_get_contents($fichier_xml);
if ($raw) {
if(eregi("<entry>(.*)</entry>",$raw,$rawitems)){
$entry = explode("<entry>", $rawitems[0]);
$nb = count($entry);
$maximum = (($nb-1) < $nombre_limite) ? ($nb-1) : $nombre_limite;
for ($i=0;$i<$maximum;$i++) {
eregi("<title>(.*)</title>",$entry[$i+1], $title);
eregi("<link(.*)/>",$entry[$i+1], $link);
eregi("<content type=\"html\">(.*)</content>",$entry[$i+1], $content);
echo "<br /><img src=\"images/picto.jpg\" /> <a ".$link[1]."\" target=\"_blank\">".$title[1]."</a><br />".$content[1]."<br />";
}
}
}
?>
Configuration: Windows XP Firefox 2.0.0.11
Salut,
pour l'utf8 : http://fr2.php.net/manual/fr/function.utf8-decode.php Cela dit si tu as des balises html qui apparraissent c'est peut être plutot du côté de html_netity_decode qu'il faut regarder. Bonne chance ;) |
Résultats pour xml en utf8 > pb importation sur html
Résultats pour xml en utf8 > pb importation sur html
Résultats pour xml en utf8 > pb importation sur html
Résultats pour xml en utf8 > pb importation sur html
Résultats pour xml en utf8 > pb importation sur html
Résultats pour xml en utf8 > pb importation sur html