RE: [PHP] Search File
| From: | Jay Blanchard | Date: | Fri, 21 Nov 2003 13:01:10 +0000 |
| Subject: | RE: [PHP] Search File | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-170556@lists.php.net to get a copy of this message | ||
[snip]
I'm trying to find a way to search text files in a directory using php.
I've
done some researching under the filesystem section on php.net but seem
to
have come up empty handed. Is there a way to do keyword searches on a
txt
file in a directory hopefully with some type of relevance ranking?
[/snip]
This approach is rather simplistic, but may point you in the right
direction.
Open each file in the directory and count the number of times each key
word appears.
Return a list of links ranked by the number of times each key word
appears in each text file.
Just a starting point...HTH