Re: [PHP] # of lines in a file

2002-12-09 Thread Ray Hunter
Might not be the most secure way, but very fast... $lines = `cat file.txt | wc -l` That will give you the number of lines...but again not the best method... On Mon, 2002-12-09 at 09:58, [EMAIL PROTECTED] wrote: > Hey guys, I've been searching the manual for a way to grab the number of > lines

RE: [PHP] # of lines in a file

2002-12-09 Thread John W. Holmes
> 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 file() will read the file into an array, one line per element, so...

Re: [PHP] # of lines in a file

2002-12-09 Thread Adam Voigt
$f = fopen("filename","r"); $data = "" fclose($f); $data = "" $lines = count($data); $certainline = $data[linenumberyouwant]; Replace filename in both places, and linenumberyouwant. On Mon, 2002-12-09 at 11:58, [EMAIL PROTECTED] wrote: Hey guys, I've been searching the m

Re: [PHP] # of lines in a file

2002-12-09 Thread John Nichel
You could try... $file = ( "/path/file.ext" ); $lines = sizeof ( $file ); [EMAIL PROTECTED] wrote: 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 y