Re: [PHP] rewind 5 lines

2004-05-17 Thread John W. Holmes
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

RE: [PHP] rewind 5 lines

2004-05-17 Thread Jay Blanchard
[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