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.