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
> 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...
$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
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
4 matches
Mail list logo