I know exactly what I want to do, but I'm not exactly sure how to go about it.
I run a game server and halflife generates log files. I need to open the last log file and only read lines that do not begin with a capitol "L " (there is a space after the L) the lines that don't begin with L is the chat that goes on inside the game. i want to print this to a website.
the files are named like this:
040022.log
040023.log
how do i make php read the directory for the last filename of the last log created?
after that i can pull each line of the file into an array with
$array=file(020023.log);
and only echo the lines that do not start with L using preg_match.
so it's a 2 part question:
1. how do i have php find the name of the last file created within a directory.
- after i get the name of the file, is the way i mentioned to print the lines i want the best way to go about it?
if you've read this far, then i thank you much =)
-mike