Re: RegExp for preg_split()
| From: | tedd | Date: | Fri, 28 Apr 2006 16:45:43 +0000 |
| Subject: | Re: RegExp for preg_split() | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-235023@lists.php.net to get a copy of this message | ||
At 6:16 PM +0200 4/28/06, Weber Sites LTD wrote:
Hi I'm looking for the RegExp that will split a search string into search keywords. while taking " " into account. From what I managed to find I can get all of the words into an array but I would like all of the words inside " " to be in the same array cell. NE1? thanks berberberber: Not knowing exactly what you want, this will sort out the "phrase strings". $string = 'Medaillons, Listels, "custom stuff", "more things", entryway, accents, showplace'; echo("$string <br/>"); preg_match_all ('/".*?"/', $string, $matchs); foreach($matchs[0] as $matchs) { echo("$matchs <br/>"); } HTH's tedd -- -------------------------------------------------------------------------------- http://sperling.com