944,174 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 2704
  • PHP RSS
Feb 6th, 2005
0

PHP File Searching

Expand Post »
I am using php to search the file names of about 10,000 files. It works now, but for it to find the file the search phrase has to be found exactly within the file name. I would really like to get a fuzzy search feature workings, but things like similar_text() have crashed the site, I am assuming because they are so intensive. I have only tried similar_text and levenshtein. Any ideas are appreciated.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
zixp is offline Offline
1 posts
since Feb 2005
Feb 20th, 2005
0

Re: PHP File Searching

Quote originally posted by zixp ...
I am using php to search the file names of about 10,000 files. It works now, but for it to find the file the search phrase has to be found exactly within the file name. I would really like to get a fuzzy search feature workings, but things like similar_text() have crashed the site, I am assuming because they are so intensive. I have only tried similar_text and levenshtein. Any ideas are appreciated.
GREP can be your friend. Those preg functions might be able to pull off what you're looking for. For instance, you might put together a statement that takes vowels "/[aeiou]/" and replaces them with an identifier tag like "##" in both your query and your array of files. Then check each file for a preg_match. I suppose it's a bit complex a script, but it shouldn't at least crash.
Reputation Points: 10
Solved Threads: 1
Newbie Poster
rice_web is offline Offline
11 posts
since Jul 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: DNS record types
Next Thread in PHP Forum Timeline: HTML Select and PHP 5 - Issue





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC