> > foreach($words as $Key=>$Value) {
> > if($ignoreWords[strtolower($Value)]) {
> > continue;
> > }
>
> You would be better off using array_diff().
Jason,
Thanks, that works except that it doesn't account for case. I want to ignore case as
it doesn't apply here. But I was able to get rid of the
associative array. So I reckoned it best to LC the question and copy it because I want
to return the original question as is back to the browser.
$_string = strtolower ($Config['input']['question']);
$words = explode(" ",$_string);
$ignoreWords =
array('brazil','like','the','this','that','why','are','there','where','find',);
$FindTheseWords = array_diff($words, $ignoreWords);
Peter
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php