Hi!
First I wan´t to thank those kind guys who helped me with the search for
words in a string. It works fine and here goes my file:
---
$fd = fopen($filename1, r);
$string = fread($fd, filesize($filename1));
fclose($fd);
if (eregi($word, $string)) {
print found the word;
}
-
Now I also
PROTECTED]
Sent: 2001. május 6. 19:04
Subject: [PHP] Can php give me row number?
Hi!
First I wan´t to thank those kind guys who helped me with the search for
words in a string. It works fine and here goes my file:
---
$fd = fopen($filename1, r);
$string = fread($fd, filesize($filename1));
fclose
Now I also wan´t to know to in which row the word was found.
Is there a simple way to add some code?
You could explode the file into an array with \r\n as the delimiter before
you do the search, then iterate through the resulting array to look for the
word, then the array index you find the
3 matches
Mail list logo