> You can read the whole file (file_get_contents) and count the number
> of "\n" in it, or read it line by line with fgets and store the lines
> in an array, and then the number of lines is the count() of the array,
> and you can use that array to store it in the database.

If you have a billion line CSV then speed may suffer somewhat though.
Best to still use fgets()  or fgetcsv() and count as you go.

Richard Heyes
HTML5 graphing: RGraph (www.rgraph.net - updated 20th June)
PHP mail: RMail (www.phpguru.org/rmail)
PHP datagrid: RGrid (www.phpguru.org/rgrid)
PHP Template: RTemplate (www.phpguru.org/rtemplate)
PHP SMTP: http://www.phpguru.org/smtp

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

Reply via email to