Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.
Trending News
Searching an array for key word lists with php?
The Scenario
Basically I have a search function that will search a database for what ever the user is typing. My plan was to first search for the full string they entered then explode the sentence and search for each key word for example.
User enters: How to volunteer with some company.
I would search for that full sentence then explode it but I don't want to search the database for words like
"us, i, it, the" etc or even the company name which would return every single page. So basically in this example trimming it down to only "volunteer" and searching for that.
I would like to know how to detect and remove all low level words such as (the, and etc) leaving behind words like (volunteer, member, reception etc). I don't wish for people to spend ages coding a function just to inform me what function I should be using would be more than sufficient.
Any help would be appreciated or if you think I should be doing this another way I would appreciate the input. Thanks
1 Answer
- SadsongsLv 75 years ago
Common words that you don't want to process are called "stop words" and there are various techniques - just Google "php stop words" and you'll find more info.