Hi!
I am searching some files for a word and if word is found I will stop
the script.
I tried with die, but I have never used it before and it didn´t work
perhaps I used it in a wrong way..

$fd = fopen($filename1, "r");
$string = fread($fd, filesize($filename1));
$fruits = explode (" ", $string);
fclose($fd);
while (list ($key, $val) = each ($fruits)) {
if (eregi("$word", $val)) {
print "$filename1".",".$key;
}
}
$fd = fopen($filename2, "r");
$string = fread($fd, filesize($filename2));
$fruits = explode (" ", $string);
fclose($fd);
while (list ($key, $val) = each ($fruits)) {
if (eregi("$word", $val)) {
print "$filename2".",".$key;
}
}
------
If I put in a word wich is found in both files than I got two answers
but I only wan´t
to know the first one. Can I prevent it to run if the word is found in
file1?

Thanks in advance for helping me.
Regards
Jan


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to