philipjterry wrote:not sure i understand your context 'inefficient, featureless flat-file approach.'
The code you posted opens a text file, reads it line-by-line, extracts pieces of data from each line, and does some sort of processing looking for information.
In other words, it mimics what a SQL database would do, albeit somewhat poorly (less efficient, no built-in features, etc. etc.).
philipjterry wrote:So I need to create a new MYSQL database to run this script?
You don't need to do anything. I was simply offering a much better way of going about what you're trying to do.
philipjterry wrote:I don't understand why I need a database if this script is not for building a website?
Huh? Who ever said anything about "building a website" ...?
philipjterry wrote:Please can you give me examples of what the values should be within those variables?
No, I can't. This is your application that is (hopefully) attempting to solve your problem. I can't tell you what the values should be any more than you can tell me what my favorite color should be.
philipjterry wrote:What actions is the script actually performing
Well my first response above gives a high-level overview of the first section of code. For more details, you could of course visit the PHP manual to answer your question about what a given function is doing.