RE: [PHP] appending to the begining of a file

From: Date: Tue, 07 Nov 2000 23:30:41 +0000
Subject: RE: [PHP] appending to the begining of a file
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-24222@lists.php.net to get a copy of this message
On Tue, 07 Nov 2000, Dusty Cohen wrote: > I suppose I could go through all that. Alternativly, I was thinking about an > insert line' command that I could write before I write the text. I hate > the i-have-seen-it-done-attitude, but guestbooks (for example) usually > have the newest posts listed FIRST, so believe that Perl has a function to > do this. But I'm really not familiar with Perl, nor do I want to be. > > > Dusty > you could read each line of the file into an array, shift the array, > add the new line to the beginning, and output the array... > > just a general idea > Do remember that the order in which stuff is stored in a filew and the order in which the contents of that file may be displayed have absolutely no relationship. Also it's probably worth pointing out here that the way files are handled relies initially on the way your operating system allows files to be manipulated. -- David Robley | WEBMASTER & Mail List Admin RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/ AusEinet | http://auseinet.flinders.edu.au/ Flinders University, ADELAIDE, SOUTH AUSTRALIA

« previous php.general (#24222) next »