note 50146 added to function.fgetcsv

From: Date: Sat, 19 Feb 2005 18:05:16 +0000
Subject: note 50146 added to function.fgetcsv
Groups: php.notes 
Request: Send a blank email to php-notes+get-85250@lists.php.net to get a copy of this message
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> ---- Manual Page -- http://www.php.net/manual/en/function.fgetcsv.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+50146 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+50146&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+50146&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+50146&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+50146&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+50146&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+50146&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#85250) next »