iceyd Posted March 20, 2011 Share Posted March 20, 2011 Hi, I was wondering if this is possible as I've been tasked (uni project) with creating a blog site that displays entries in order of creation. From what I've seen, when modifying the file I can only add entries from the bottom line and not from the top without replacing the previously stored content. Thank you. Quote Link to comment Share on other sites More sharing options...
tomfmason Posted March 20, 2011 Share Posted March 20, 2011 a simple way could be something like <?php $data = "some data \n"; $file = '/path/to/file'; $data .= file_get_contents($file); file_put_contents($file,$data); ?> Quote Link to comment Share on other sites More sharing options...
iceyd Posted March 20, 2011 Author Share Posted March 20, 2011 Thank you very much for the quick reply. It worked a charm Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.