- <description>
- <![CDATA[
lkesea
]]>
</description>
El codigo que utilizo es el siguiente:
Código PHP:
<?
function lit_xml($fichier,$item,$champs) {
if($chaine = @implode("",@file($fichier))) {
$tmp = preg_split("/<\/?".$item.">/",$chaine);
for($i=1;$i<sizeof($tmp)-1;$i+=2)
foreach($champs as $champ) {
$tmp2 = preg_split("/<\/?".$champ.">/",$tmp[$i]);
$tmp3[$i-1][] = @$tmp2[1];
}
return $tmp3;
}}
$xml = lit_xml("http://etc....","item",array("title","link","pubDate","description"));
echo "<ul>";
foreach($xml as $row){
if($i < 4){
$row[2] = str_replace("+0000","",$row[2]);
$i++;
echo "<li>"
."<A target=_blank href='".$row[1]."' class='noti'>".$row[0]."</A><br><font class='noti'>".$row[2].""
.$row[3]
."</font></li>";
}}
echo "</ul>";
?>