You are here: Using File to count number of lines « PHP « IT news, forums, messages
Using File to count number of lines

Posted by Tom Chubb on 08/04/05 15:08

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация