I have a php page that opens a log file and reads it into $data. I am trying to then search through $data and find which drive letter was recorded in the log file... but I can not get it to work:
$data=file($rfile) or die("Couldn't Read File");
//get drive information from report
$finddrive = ".:\\\";
echo $finddrive;
if (ereg($finddrive, $data, $reg)) echo "Drive information: '$reg[0]'";
exit;
The only result I get is a warning:
Warning: ereg(): REG_EESCAPE:7trailing backslash () in c:\WebDev\generate.php on line 96
The file contains the following text (which gets read into $data):
Status = termination requested.
File list
F:\
Any help would be appreciated. I thought it might be that I need to somehow loop through $data ? Not sure since I am a newbie.
Thanks in advance!