I suggest you should create a parsing loop to look at each line in the file…
You would need to read all of the lines in your file and check each one for the expiration date. It really depends on how you acquire the file. If it is created from a PHP program, you can format the date so that
it is easy to pull out of each line. If not, you have to parse thru all of the lines in the file and locate the ones
that are expired. Loosely, grab each line from the file. Place each line into a variable. Then, test it for the
correct expression. If each of your lines are always in the exact format you posted, you can grab the data
with ease. Let’s say the line is in a variable named $line…
$start = strpos($line, “<”);
$date = trim(substr($line, $start));
This would give you the string after the “<” which should be your date. ( In text form, that is! )
Then, you would need to compare it to the current date by using it in a date format instead of text.
You can get today’s date/time like this:
$today = date(“Y-m-d H:i:s”); You will have to check the PHP “date()” function to match it to your layout.
Then, you can compare with something like: if ($date < $today) { do not pass this line to output… }
Well, there you have a place to start with… Either way, you will have to create a loop to check each line,
one at a time to check the dates… Good luck, show us some code if you have issues…