Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 17th, 2005, 05:20 AM
Alexander Ross
Guest
 
Posts: n/a
Default split q

is there an easy way to split a string on SPACE except if that SPACE is
within QUOTES?

i.e. - $str = red green blue yellow "blue green" returns
[red,green,blue,yellow,blue green]

?


  #2  
Old July 17th, 2005, 05:20 AM
Bruno Desthuilliers
Guest
 
Posts: n/a
Default Re: split q

Alexander Ross wrote:[color=blue]
> is there an easy way to split a string on SPACE except if that SPACE is
> within QUOTES?
>
> i.e. - $str = red green blue yellow "blue green" returns
> [red,green,blue,yellow,blue green]
>
> ?
>[/color]
preg_split() should do it...
http://www.php.net/manual/en/function.preg-split.php


 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles