split values


Posted on 16th Feb 2014 07:03 pm by admin

I have values that are returned to me in this format:

name=>test,age=>49

Did you know?Explore Trending and Topic pages for more stories like this.
What I want to get out of this is an array like this

array('name'=>'test','age'=>'49');

I was hoping some one could let me know the best way to do this. I was thinking about using preg_split() but wasnt sure if it was the best method. Also not that good with regex. Any help is appreciated.
No comments posted yet

Your Answer:

Login to answer
330 Like 6 Dislike
Previous forums Next forums
Other forums

An odd assignment statement. Can someone explain this assignment to me?
What purpose is served by the bit of code between the two equal signs in the $installurl set? Is th

Loop column after 2 results
Hello All.

Here is what I have:

Client ID Company name Clien

How can I Compare two xml documents?
Hi all,

I am doing a POC for my project and I am using XE database 10g version.

Multiple Pages
Hi. Im very new to php. I'm trying to create a basic login/registration page.

So I have a bas

Odd or Even
Inside of a while loop I need to echo several rows of info...easy enough.

In the loop (for th

single values into sql field
i have a form which i want the user to able to select multiple answers. But i want the answers to be

Shuffle Array
Hi,

I am writing a script for a game that needs players to randomly be assigned a target (ano

Optimize Code
Just started getting into the use of cookies. The following code will redirect users to a set URL s

Problem with HTTP Caching...?
Hi there, im trying to implement caching. But it doesn't always work.
I post it here because ther

Can we convert non uni code system into unicode
Hi All,

Presently i am using non-unicode system and the sap version is 4.7.
Can i c

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash