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

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

email CODING Problem
Email coding problem.

I need to send a section of the info to $tf and the same as a Cc to $em

jquery validation in codeIgniter
hai i need to add client side validation to my fiels which are selected in a forloop.the fields are

include function being weird?
I have a very simple system to grab an IP outputted by a PHP file.. (for a project I have) but it ou

values in array being escaped
I would like to submit some values - back to the same form for checking before processing...

ctype() validation - allowing illegal characters
Hello,
I use ctype() to filter and validate a user form. However, I am trying to allow certain c

C problem struct and string
Hi guys,

This is my first post and I'm hoping the experts here can help me solve my problem.<

Perplexing problem showing a .jpg
Please disregard..........I figured it out

Displaying data from MySql a different way
Hi all,
I'm pretty new to php and MySql and have hit a problem.

I am able to display data

Executing an exe
Hi. I have some bizarre problem with exec (other any other method) to launch exe's. I am making a ga

Multi dimensional arrays
If I put in this code:

1
2
3
4
5
6
7
8
9
10
11
12
13<

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