Snippets
Here is your code snippet
mozillaZine newsLatest news from mozillaZine
<?php
$xmlfile = fopen("http://www.mozillazine.org/contents.rdf", "r");
if(!$xmlfile)die("cannot open the xml file");
$readfile = fread($xmlfile ,40000);
$searchfile = eregi("<item>(.*)</item>", $readfile ,$arrayreg);
$filechunks = explode("<item>", $arrayreg[0]);
$count = count($filechunks);
echo "<table border='1'>";
echo "<th colspan='3'>latest news</th>";
for($i=1 ; $i<=$count-1 ;$i++)
{
ereg("<title>(.*)</title>",$filechunks[$i], $title);
ereg("<link>(.*)</link>",$filechunks[$i], $links);
ereg("<description>(.*)</description",$filechunks[$i],$desc);
echo "<tr><td>";
echo $title[1];
echo "</td><td>";
echo "<a href ='$links[1]'\>$links[1]</a>";
echo "</td><td>";
echo $desc[1];
echo "</td></tr>";
}
echo "</table>";
?>