Hi guys!
I am working on a script that is reading a log file created by pppd, I am using the fgetcsv to find the lines I want in the log file. There is no problems when the log file is completely wrote to get the strings I want from that file, but when I am reading it as it is written it won't find the strings I am looking for... here is the part of code that is causing me problems;
$fp = fopen ("log.txt", "r");
while(($data = fgetcsv ($fp, 1000, "\r")) && ($status == 1))
{
$num = count ($data);
for($d=0; $d<$num; $d++)
{
if($data[$d] == $filter2)
{
print $data[$d] . "<br>";
$status = 2;
}
if($data[$d] == $filter3)
{
print $data[$d] . "<br>";
$status = 3;
}
if($data[$d] == $filter4)
{
print $data[$d] . "<br>";
$status = 3;
}
if($data[$d] == $filter5)
{
print $data[$d] . "<br>";
$status = 3;
}
}
}
fclose ($fp);
That is the last part of my application and I can't find why it would not work !?! Help and suggestions would be very appreciated! 🙂
thanks !
J-F