From: "Martin Hjort Eriksen" <[EMAIL PROTECTED]>
> I have a file where the pointer is set at EOF.
>
> Is it possible, in a very easy way, to rewind it 5 lines? Thereby being
> able to return the last 5 lines of the file with "fgets".
You could use rewind() if you know how many bytes you need to
[snip]
I have a file where the pointer is set at EOF.
Is it possible, in a very easy way, to rewind it 5 lines? Thereby being
able to return the last 5 lines of the file with "fgets".
[/snip]
Count the lines, subtract five, cycle through the file again and only
get the last five.
--
PHP Genera
I have a file where the pointer is set at EOF.
Is it possible, in a very easy way, to rewind it 5 lines? Thereby being
able to return the last 5 lines of the file with "fgets".
regards
Martin Eriksen
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
3 matches
Mail list logo