note 50146 deleted from function.fgetcsv by felipe
| From: | felipe@php.net | Date: | Sun, 10 Feb 2008 13:32:26 +0000 |
| Subject: | note 50146 deleted from function.fgetcsv by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-135979@lists.php.net to get a copy of this message | ||
Note Submitter: slyi
----
heres a version that take a bugzilla url and spits the results as rss
<?php
$bugzillaurl="http://www.reactos.com/bugzilla/";
$bugquery= $bugzillaurl .
"buglist.cgi?query_format=&bug_severity=blocker&ctype=csv";
header('Content-type: text/xml');
echo "<?xml version=\"1.0\" ?>\n";
?>
<rss version="2.0">
<channel>
<title>bugzilla csv2rss</title>
<link><?=$bugzillaurl?></link>
<description>bugzilla csv2rss</description>
<language>en-us</language>
<?php
$row = 0;
$handle = fopen($bugquery, "r");
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
if($row == '0') { $row = '8';} //skip title stuff
else{ // display all bugs
$row++;
echo "<item>\n";
echo "<title>" . htmlspecialchars($data[7], ENT_QUOTES) .
"</title>\n";
echo "<description>" . htmlspecialchars($data[7], ENT_QUOTES) .
"</description>\n";
echo "<link>" . $bugzillaurl . "show_bug.cgi?id=" . $data[0] .
"</link>\n";
echo "</item>\n";
}
}
fclose($handle);
?>
</channel>
</rss>