Monil Chheda wrote:

Am I MISSING SOMETHING ?????



<?php

$flag = "false";

if ($fp = fopen("web.log","r")) {

while (!feof($fp)) {

$line = fgets($fp,1024);


Here you check if there is an end of string $line, sure there is, there are no infinite strings

                if (ereg("\$",$line)) {
                           $flag="false";
                        }
                if ($flag=="true") {
                        $linearray = explode(" ",$line);
                        $ip = $linearray[0];
                        $date = $linearray[1];
                        $keywords = $linearray[2];
                        echo "$ip    $date $keyowrds";
                        }

And here you check if the string has a begining, and you guess it, it does

                if (ereg("\^",$line)) {
                          $flag = "true";
                                }

} } else {
echo "Could not open file";
}


?>



Take a closer look at regular exprations, this is the way to go


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



Reply via email to