RE: [PHP] counting lines in a file?
| From: | Boget, Chris | Date: | Tue, 03 Oct 2000 16:50:50 +0000 |
| Subject: | RE: [PHP] counting lines in a file? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-18447@lists.php.net to get a copy of this message | ||
> $f = fopen($filename);
> $x=0;
> while(!feof($f)){
> $tmp = fgets($f,10000000);
> $x++;
> }
> now $x contain the number of lines
Wait a second...
Your lines regularly have 10,000,000 characters in them?
The only thing the above will do is tell you how many
tens of million characters you have in the file.
Chris