Using File to count number of lines

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

 



I'm having a problem with the following code:

<?php 
$file = "http://www.mysite.co.uk/mailing_list_database.list";; 
$lines = count(file($file));  
echo "$lines "; 
?>

I'm trying to show the number of subscribers to my visitors from a
text file, but it returns a value of 1 when it should be 5000.
I think it's to do with recognising the line break but I don't know
how to make it work!?!

(I've looked on php.net for the file, fopen & count functions and
can't find anything, although fopen mentions using the -t mode.
Any ideas?

Thanks,

Tom

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