Finally Displaying XML

First display from where the RSS Feed is from …, ie display the site name, link etc.

echo ("<h5><a href='$link' title='$desc'>".$title."</a></h5>\n<br />".date('F d, Y H:i:s', $dt)."<p> </p>"); 


Now move throgh a for loop to finally display the XML in a well formatted HTML
Note here how I have used the div tag to position the content… You can adjust the [width], [left] style elements to suite your page.

echo ("<div style='position:absolute;left:5px;width:150px;font-size:8pt;font-family:trebuchet ms;border:1px dashed silver;padding:3px;'>");

for ($i=0; $i<count($arr['title']); $i++)
{
  echo ("<p>\n");
  echo ("<a href='".trim($arr['link'][$i])."'>".trim($arr['title'][$i])."</a><br />\n");
  echo (trim($arr['desc'][$i])."\n");
  echo ("</p>\n");
}
echo ("</div>");

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.