Re: Splitting a string first by quotes then spaces

From: Date: Mon, 09 Jul 2001 23:31:42 +0000
Subject: Re: Splitting a string first by quotes then spaces
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-57037@lists.php.net to get a copy of this message
Try this: first test to see if the query contain quotes, if it does, go to a seperate routine that splits the string into an array, first however, you must make sure there is a space before the query and one after the query ( you add these) *then* split the string into an array, explode on the quotes....you will find that every odd number element of the array has to be a string that was enclosed in quotes. If you have elements 0, 1, 2 and 3, then 1 and 3 will always be strings that were encloded in quotes. The spaces before and after the query that you insert assure that if the user makes the first part of the query a quote, the routine will detect it as an odd number element. rm __________________________________________________ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail http://personal.mail.yahoo.com/

« previous php.general (#57037) next »