mwookie
08-29-2007, 03:57 PM
Can someone tell me the most effecient way to remove blacklisted words from a string? I am working on my stock image search engine (http://www.imagetrail.net) . I have noticed that a lot of people put in words like "image" and "photo" into their searches, which reduces the results, because they are all images / photos and most photographers don't use this as a keyword.
SOoo.. Is is best to explode() the string and do an in_array() comparison against an array of "bad words" or maybe use a regular expression to pull out the words?
Any ideas or (even better) code tidbits would be so helpful, thanks.
_________________________
"Insanity is hereditary - you get it from your children." Sam Levenson
Company (http://www.emblemsoftware.com) – Projects ($1 Images for your website (http://www.imagetrail.net/search_background_photos.php)– New Mexico Resource Directory (http://www.newmexicodirect.net))
SOoo.. Is is best to explode() the string and do an in_array() comparison against an array of "bad words" or maybe use a regular expression to pull out the words?
Any ideas or (even better) code tidbits would be so helpful, thanks.
_________________________
"Insanity is hereditary - you get it from your children." Sam Levenson
Company (http://www.emblemsoftware.com) – Projects ($1 Images for your website (http://www.imagetrail.net/search_background_photos.php)– New Mexico Resource Directory (http://www.newmexicodirect.net))