PDA

View Full Version : Anybody offer some help to me?


apathy
07-16-2002, 09:51 PM
Hey... could anybody help me with this please?

I can't remember the function to reverse the way in which data is inputted into a file - for example, data may be at the bottom but there's something that reverses it that makes it appear at the top of the file. I've forgotten what it is, can anybody give me some help? Thanks.

firepages
07-17-2002, 01:30 AM
sorry can you be more specific ? a text file ? an array ? not quite with you ...

mordred
07-17-2002, 10:12 AM
If we are talking about files here, you will have to assign the data to a variable, open the file, read its contents, append them to previously mentioned string variable and rewrite the file with the new string variable as new contents.

apathy
07-18-2002, 09:51 PM
It's a text file. Thanks. :)

gorilla1
07-20-2002, 04:41 AM
$newdata = file('your.txt');
$newdata = array_reverse($newdata);

G