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

2005-09-10 Thread Robin Vickery
On 9/7/05, Paul Groves [EMAIL PROTECTED] wrote: 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

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

2005-09-08 Thread Paul Groves
Brent Baisley wrote: It sounds like you are trying to build a full text search string, perhaps for searching a MySQL database? Actually, I was thinking of doing a MySQL non full-text search, hence the need to split the words/phrases up so that they could then be fed into individual WHERE

[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 work:

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

2005-09-07 Thread Gustav Wiberg
- Original Message - From: Paul Groves [EMAIL PROTECTED] To: php-general@lists.php.net 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 input box

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: php-general@lists.php.net 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

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

2005-09-07 Thread Gustav Wiberg
- Original Message - From: Paul Groves [EMAIL PROTECTED] To: Gustav Wiberg [EMAIL PROTECTED] Cc: PHP General php-general@lists.php.net Sent: Wednesday, September 07, 2005 5:45 PM Subject: Re: [PHP] Breaking up search terms into an array intelligently Gustav Wiberg wrote

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

2005-09-07 Thread Brent Baisley
It sounds like you are trying to build a full text search string, perhaps for searching a MySQL database? Below is the function I came up with a while ago. It's worked fine, although it currently does not check for multiple spaces, but that should be easy to change. It uses a space as a