RE: Using File to count number of lines

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

 



[snip]
When I open the list in notepad everything is on one line with a
square box character.
When I open it in wordpad, it's one email address on each line.
[/snip]

Sounds like that there are not any newline characters in the file. You
could do something like this...

$theFile = fopen("http://www.mysite.co.uk/mailing_list_database.list";,
"r");
while(!feof($theFile)){
   $theLine = fgets($theFile, 4096);
   $theCount++;
}
fclose($theFile);

echo $theCount;

-- 
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