Hi,

I am facing some trouble with the file( ) function. I understand that it
returns the contents of the file in an array. Also, I am able to print the
lines using the echo function. However, whenever I try to compare the
contents of an array using strcmp, or ==, the page simply keeps 'loading',
instead of printing results.

The following is the code that I try:

$name = $_POST["filename"];
$lines = file($name);
$i = 0;
$len = sizeof($lines);
//echo $i;
while($i < $len) {
 //echo $lines[$i];
 $temp = $lines[$i];
 $temp = trim($temp);
 //echo $temp;
 if($temp1 == '--------------------------------------') {
   echo $i;
   return $i;
 }
 else
   $i++;
}

I think that the way the lines of the file are stored in the array may be
the problem, but I do not know what I am supposed to change. Any help would
be appreciated.

Thanks.

MM.

Reply via email to