Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 2279 | Replies: 6
![]() |
This code opens and reads a line into $line until there are no more lines:
file_get() can be used as well, to load each line into an array, if you prefer to work with it like that.
php Syntax (Toggle Plain Text)
<?php $fp = fopen('file.csv', 'r'); while (!feof($fp)) { $line = fgetcsv($fp, 4096); echo $line; // do whatever you need here } fclose($fp); ?>
file_get() can be used as well, to load each line into an array, if you prefer to work with it like that.
Last edited by Ezzaral : Jul 23rd, 2007 at 2:08 pm.
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)






Linear Mode