Page 1 of 1

How to exclude some words from the input for searching

Posted: Fri Jun 25, 2004 2:10 am
by Calimero
If for Ex. user inputs this in a single textfield:

auto moto cars service rooler

What is the code in PHP to exclude (for Ex. rooler) some word.

Thanks Ahead!

Posted: Fri Jun 25, 2004 2:13 am
by markl999

Code: Select all

$exclude = array(
  'foo', 'bar', 'flibble'
);
$search = str_replace($exclude, '', $search);