Monil Chheda wrote:
Am I MISSING SOMETHING ?????Here you check if there is an end of string $line, sure there is, there are no infinite strings
<?php
$flag = "false";
if ($fp = fopen("web.log","r")) {
while (!feof($fp)) {
$line = fgets($fp,1024);
And here you check if the string has a begining, and you guess it, it doesif (ereg("\$",$line)) { $flag="false"; } if ($flag=="true") { $linearray = explode(" ",$line); $ip = $linearray[0]; $date = $linearray[1]; $keywords = $linearray[2]; echo "$ip $date $keyowrds"; }
Take a closer look at regular exprations, this is the way to goif (ereg("\^",$line)) { $flag = "true"; }
} } else {
echo "Could not open file";
}
?>
Could any one please help me
Thanks...
-Monil Chheda
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php