Hey guys,
I need to maintain short list of messages in a text log file. I was just googling for the best way to delete the first or last line and insert a new one.
Basically with each access I'll delete a line from the top (or bottom could work too) and insert a new line at the other end. (so it scrolls basically)
If your curious, this is the status of a daily cron job, I basically want to know the status up to the last 10 days.
I'm not asking for code, but something pretty light. (ie if I decided i wanted 100 or 300 lines). Most of you know my PHP skills and know I can just put it in an array and rewrite to the file after I'm done, but
can this be done in two lines of code and accessing the file resource only once (ie one file handle).
hope that makes enough sense, I'll post the code once I have something,
Thanks
Dan