FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Help me split up this string
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Help me split up this string [message #171055 is a reply to message #171054] Sun, 19 December 2010 21:31 Go to previous message
ngardner is currently offline  ngardner
Messages: 2
Registered: December 2010
Karma:
Junior Member
On Dec 19, 3:13 pm, ngardner <ngardner...@gmail.com> wrote:
> I need a function that can split up my string by spaces, but with
> grouped words based on quotes. For example...
>
> This is "my first" test "query string" to try
>
> should be formatted into an array like...
> 0=>This
> 1=>is
> 2=>my first
> 3=>test
> 4=>query string
> 5=>to
> 6=>try
>
> Anyone have a function like this, or help me determine the best way to
> accomplish this? Thanks!

Found the str_getcsv() function which did this for me.
$keywords = str_getcsv($string,' ','"');
[Message index]
 
Read Message
Read Message
Previous Topic: cPanel Filter Email Pass-Thru Technique?
Next Topic: Stats comp.lang.php (last 7 days)
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Sep 19 16:32:39 GMT 2024

Total time taken to generate the page: 0.05183 seconds