Anyone have any append to top of flat file code?
Posted: Fri May 18, 2007 1:47 am
Hello all
I am learning the ropes in PHP at the moment, and I have the append-to-bottom using fopen, working fine. however, I would like to also be able to append to the top without overwriting any old data in the file. So it works like a stack, whatever was there at the top originally gets pushed down a notch and the new data goes on top. I have tried using r+, but obviously that only places the cursor at the top.
Any help would be greatly appreciated.
I am learning the ropes in PHP at the moment, and I have the append-to-bottom using fopen, working fine. however, I would like to also be able to append to the top without overwriting any old data in the file. So it works like a stack, whatever was there at the top originally gets pushed down a notch and the new data goes on top. I have tried using r+, but obviously that only places the cursor at the top.
Any help would be greatly appreciated.