Parsing string into array if user types in quotation marks
Posted: Fri Dec 19, 2008 1:42 pm
Hi all,
I'm basically have a page where the user can type in something like
cars for sale in "St. Louis"
I've been using str_word_count to break the string into an array for each word. But, the problem I have is that I want the array to to return
cars
for
sale
in
st. louis
NOT
cars
for
sale
in
st.
louis
I'm wondering if there is a php function that will convert the string into an array but combine any words with quotation marks as one.
Thanks,
R
I'm basically have a page where the user can type in something like
cars for sale in "St. Louis"
I've been using str_word_count to break the string into an array for each word. But, the problem I have is that I want the array to to return
cars
for
sale
in
st. louis
NOT
cars
for
sale
in
st.
louis
I'm wondering if there is a php function that will convert the string into an array but combine any words with quotation marks as one.
Thanks,
R