I want to parse a file to find a specific location in the file. We will assume that the particular line could be anywhere in the file. Now before or after this line I want to insert more lines. We will also assume I know exactly what to insert. I use PHP 4.3.x with Apache, but would prefer if I could get some code that didn't have to be on Apache.
I am not quite sure how to explain this. Here is a sample output:
Sunday, June 1, 2003
Data (00847 data) at 643 PM PDT, etc etc
Textblock data.
Data (0556 data) at 655 PM PDT, etc etc
Textblock data.
Saturday, May 31, 2003
Data (0087544 data) at 555 AM PDT, etc etc
Textblock data.
As you can see (or not) the times are in ascending order while under the dates, but the dates are listed in descending order. I want to be able to submit each of these times in any order on my form and get that ouput above. I have tried to show that I need to look through the each line to find particular phrases because the lines don't just have the times, and as for the date I want only to look for "June 1, 2003" not "Sunday, " or any day. Also it has to be formatted this way and I don't want to use a database. Please help if you can.