Re: [PHP] Breaking up search terms into an array intelligently

2005-09-08 Thread Paul Groves
rd (*) to end of word if(!$isPhrase) { $searchItems[$i].= '*'; $i++; } //Check for end of Phrase if(substr($searchItems[$i],-1) == '"') { $isPhrase= false;

Re: [PHP] Breaking up search terms into an array intelligently

2005-09-07 Thread Paul Groves
Gustav Wiberg wrote: - Original Message - From: "Paul Groves" <[EMAIL PROTECTED]> To: Sent: Wednesday, September 07, 2005 4:54 PM Subject: [PHP] Breaking up search terms into an array intelligently I want to be able to break up a number of search terms typed into an

[PHP] Breaking up search terms into an array intelligently

2005-09-07 Thread Paul Groves
I want to be able to break up a number of search terms typed into an input box into array, simple enough one would think, just use explode, e.g $array = explode(" ", $string); But what if I want to be able to cope with search terms seperated by > 1 space (a common typing error)? This should wor