i am trying to prevent a user from searching for the words bread, white wheat, rye, rolls
if a user searches those words results would be about 98% of database being returned
this is how i am trying to do it but is not working any ideas
if (isset($_GET['search'])) {
$searchTerms = trim($_GET['search']);
$searchTerms = strip_tags($searchTerms); // remove any html/javascript.
if (strlen($searchTerms) < 2) {
$error[] = "Search terms must be longer than 2 characters.";
if (strlen($searchTerms) == 'bread, rolls, white, wheat, rye') { <--------- this line
$error[] = 'Your Search Is Too Broad, Please Try Again!!';
}