stop words function This simple php script is a function that takes a list of stop words (commnly occuring words that are of no use to a search engine) and strips them out of a variable term. This is similar to google removal of common words.
<?php function stopWords($term, $stopwords_file) {
//load list of common words $common = file($stopwords_file); $total = count($common); for ($x=0; $x<= $total; $x++) { $common[$x] = trim(strtolower($common[$x])); }
//make array of search terms $_terms = explode(" ", $term);