I would probably do something like...
take the string and remove any special characters from it
then use the explode() function to put all the words (seperated by spaces) into an array
Then I would use those key words to give some search results
Something like this...
PHP Code:
$pattern = "/^[A-Za-z]/"; $replace = "\"; $search preg_replace($pattern, $replace, $search);
That should remove all non alpha characters
PHP Code:
$search_array=explode(" ", $search);
$search_array should contain an array with all the words used in the search.
From there, I'm not really to sure what you're trying to do. But hopefully this gets you started, what exactly are you using to compare the search strings with?
|