Trying To Read - Show A Csv File Line By Line

From: Date: Fri, 20 Mar 2009 21:11:00 +0000
Subject: Trying To Read - Show A Csv File Line By Line
Groups: php.general 
Request: Send a blank email to php-general+get-290442@lists.php.net to get a copy of this message
Newbie ... I'm trying to Trying to read / show a csv file line by line ... I think that a csv file would have a line delim of chr(10) or chr(13) or something ... Fgets doesn't seem to see it.... Q: How do I get it to see 1 line at a time and display it with <br/> in between? Thanks in advance........ ========= <?php $handle = fopen("try3.csv", "r"); if ($handle) { while (!feof($handle)) { // $buffer = fgets($handle, 4096); // tried w & w/o 4096 length $buffer = fgets($handle); echo $buffer.'<br/><br/>'; } fclose($handle); } ?> -- Thanks - RevDave Cool @ hosting4days . com [db-lists 09]

« previous php.general (#290442) next »