Trying To Read - Show A Csv File Line By Line

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux