l3vi
05-01-2004, 08:11 PM
Hello,
I was wondering, how would I go about finding the amount of lines in a file? I have a file, and it has a lot of stuff. Ex:
55667
42aklsdf
aasdkfk6
3sdjf'as
39810-4
mmzjc
How would I find out that there are 6 lines in this file, using php?
Thanks,
l3vi
Never mind, I called up one of my friends and figured out how to do this :D If you want to know you use this line of code:
$lines = file ('filename');
$num_lines = count ($lines);
echo ("Total lines in file: " . $num_lines);
I was wondering, how would I go about finding the amount of lines in a file? I have a file, and it has a lot of stuff. Ex:
55667
42aklsdf
aasdkfk6
3sdjf'as
39810-4
mmzjc
How would I find out that there are 6 lines in this file, using php?
Thanks,
l3vi
Never mind, I called up one of my friends and figured out how to do this :D If you want to know you use this line of code:
$lines = file ('filename');
$num_lines = count ($lines);
echo ("Total lines in file: " . $num_lines);