Re: rewind 5 lines

From: Date: Mon, 17 May 2004 21:07:49 +0000
Subject: Re: rewind 5 lines
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-186433@lists.php.net to get a copy of this message
From: "Martin Hjort Eriksen" <martin@hardcoder.dk> > 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 go back. You could also use file() and just grab the last 5 array entries. ---John Holmes...

« previous php.general (#186433) next »