Jump to content

spellbinder

New Members
  • Posts

    1
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

spellbinder's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi, I'm new here and i'm still reading the tutorials but it's a bit complicated for me.. so i'm wondering if someone can check if my parsing is correct because i'm stuck in doing my assignments... thanks in advance <?php $URL="http://www.linuxsig.net/project/todayrss.php"; $file = fopen($URL, 'r'); if(!$file) die("Cannot open file."); include("dbconnect.php"); @mysql_query("DELETE FROM 'today'", $db); //read rss feed contents $readfile = fread($file, 1000); $searchfile = eregi("<item>(.*)</item>", $readfile, $array); //place articles in array $article = explode("<item>", $array[0]); $counter = count($article); echo "<table border='1'>"; echo "<th colspan='2'>MMU Lastest News</th>"; //loop to display all bulletins for ($i=0; $i<count; $i++) { //fetch titles ereg("<title>(.*)</title>", $article[i], $title); //fetch categories ereg("<category>(.*)</category>", $article[i], $category); //fetch descriptions ereg("<description>(.*)</description>", $article[i], $description); //fetch links ereg("<link>(.*)</link>", $article[i], $link); echo "<tr><td>"; echo $title[1]; echo "</td><td>"; echo "<a href='$link[1]'\>$link[1]</a>"; echo "</td></tr>"; } echo "</table>" ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.