RE: [PHP] Looping needs to re-open parm file

2002-12-19 Thread John W. Holmes
> I'm reading a paramter file and a text file.
> Per line of the text file I want to check if there is a word in there
from
> the parameter file.
> However I need to open and read the parameter file for each line in
the
> text
> file. How can I change this?

Can't you read the param file first into an array, and then loop through
the text file, using in_array() to see if a line matches a param?

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Looping needs to re-open parm file

2002-12-19 Thread Wico de Leeuw
Hiya

something like this

if ($FileContent = file("d:\MyPhp\\test.ora") AND $IniContent = 
file("d:\MyPhp\initORA.ini")) {
foreach($FileContent AS $line) {
if (in_array($line, $iniContent)) {
 echo "$Line\n";
}
}
}
?>

At 12:00 19-12-02 +0100, Jacob van Zanen wrote:
Hi All,

I'm reading a paramter file and a text file.
Per line of the text file I want to check if there is a word in there from
the parameter file.
However I need to open and read the parameter file for each line in the text
file. How can I change this?

Followin is the code I have.


\n");
 }
 }
}
?>



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Looping needs to re-open parm file

2002-12-19 Thread Wico de Leeuw
Did you look at:
http://www.php.net/manual/en/function.file.php
Puts all lines in an array

Gr,

At 12:00 19-12-02 +0100, Jacob van Zanen wrote:

Hi All,

I'm reading a paramter file and a text file.
Per line of the text file I want to check if there is a word in there from
the parameter file.
However I need to open and read the parameter file for each line in the text
file. How can I change this?

Followin is the code I have.


\n");
 }
 }
}
?>



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Looping needs to re-open parm file

2002-12-19 Thread Jacob van Zanen
Hi All,

I'm reading a paramter file and a text file.
Per line of the text file I want to check if there is a word in there from
the parameter file.
However I need to open and read the parameter file for each line in the text
file. How can I change this?

Followin is the code I have.


\n");
 }
 }
}
?>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php