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

Problem with php's rename function
So, i'm having a problem with the php rename function. Basically my script 'delete_user.php' attempt

first few characters only
hi, does anyone know how to use PHP to take the first few words of a text and limit them? i have see

search function
HI guys,

if anyone could point us in the right direction of how to do this, or provide some t

Data storage spaces in varchar2
Trying to understand what's happening.
I am selecting a value from a table that is defined as c

split string
Hi all

i have some names (imploded by comma):
Code: toronto,paris,madrid
Now, i would

Socket problem
Hello,

Earlier I posted about my problem with my socket script. It took up to 100% CPU usage.

Adding meta tags under Zend FW
Hello there, recently has come to my hands the FTP of a website which is running under Zend, I would

Can php detect connection speed and thereafter swap out elements?
No code to post, lads, yet. Just looking for a yay or nay at this stage:

Can a php script be

Help building / using array
First - this is a cross-posting, if this is wrong I apologise! What started out as a MySQL query que

Mysql query, two times?
Hello to all,

I'm new to php coding and i like it alot. I need help with some noob stuff.

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