Re: [PHP] problem encountered with stristr-based function

2006-01-20 Thread David Grant
George, George Pitcher wrote: For info, I am trying to highlight search terms in results. If you're searching and replacing within HTML, you ought to be aware of issues if someone's search term happens to be an HTML tag or attribute. For example, Alice might search for href and get the

RE: [PHP] problem encountered with stristr-based function

2006-01-20 Thread George Pitcher
2006 2:54 pm Cc: php-general@lists.php.net Subject: Re: [PHP] problem encountered with stristr-based function George, George Pitcher wrote: For info, I am trying to highlight search terms in results. If you're searching and replacing within HTML, you ought to be aware of issues if someone's

Re: [PHP] problem encountered with stristr-based function

2006-01-20 Thread Richard Lynch
On Fri, January 20, 2006 8:44 am, George Pitcher wrote: function terms($term,$field){ if(strlen($term)0){ if(!stristr($term, $field) === FALSE) { This is quite contorted... And you have the arguments swapped, which is the real problem. if(stristr($field, $term)){ $output =