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

VAT
how should I deal with VAT?

if I have a product that costs £5.00 and VAT @ 17.5% (£0.87

how to remove in php string display
My code is $message="We're looking at developing our website."; $body= "My mess

Last character removed
I have created a string from an array. I have inserted commas from my form values. I am trying to re

Add a sign-up feature to a flat file login script
I'm working on a flat file login script and I would like to add a sign-up feature to it with a email

Get dump of MySQL DB from Live Site
I'm after an easy, but secure way of generating and importing a MySQL dump from a remote server.

php web service error
hey guys,
I'm working on a project requires the use of web services. I've been trying a few tutor

is_dir() problem
Hello,

I'm buidling a php scripts that dynamically get's subfolders from a specific folder.

Keeping track of php uploads
Hello all.

I was looking at the way PHP handles file uploads.
It seems that PHP uses a tem

dinamic "textboxes"?
Ey all, my first post here, i hope its not a hard one

I display mysql results in a table

array_map() probably obvious mistake
The code below is part of a class to escape strings, but should also accept an array, using array_ma

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