Re: # of lines in a file
| From: | Scott Hurring | Date: | Mon, 09 Dec 2002 23:58:13 +0000 |
| Subject: | Re: # of lines in a file | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-127579@lists.php.net to get a copy of this message | ||
... or, if the file is HUGE and you don't want to read it all into RAM
using file(), you could open the file using fopen() and read line-by-line
until you get to the one you want. (or use fseek() fread() funcs to grab
a big chunk of text at once and then count the newlines, and loop until
you find the line you want)
TIMTOWTDI :-)
--
Scott Hurring
Systems Programmer
EAC Corporation
scott (*) eac.com
--
<Clivus2k1@aol.com> wrote in message news:1e.415a90e.2b2625d3@aol.com...
> Hey guys, I've been searching the manual for a way to grab the number of
> lines in a file and read a particular line from it, however I found no
> solution to my problem so I'm wondering if any of you out there could help me
> :-)
>
> - CS
>