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

SCO Unix
I know this might not be the place to ask, but, can anyone tell me if SCO Unix comes with PHP built

function not returning the correct value
I have a program that needs to return a value from a function. I have an output statement inside the

Count
Getting the same count everytime

Code:
$visitquery = mysql_query("SELECT COUNT(*) FR

line breaks in between fetched file names
Hi,

I have this code:
Code: <?php
if($dir = opendir('files')){
while (($f

Simple code help with redirects
I am trying to figure out a redirect script that detects if the browser is IE 7 and if it does, redi

pagination numbering pattern
Hello,

I have following code which works great for pagination. but i have small issue now.

Syntax error
hi im having a little trobble with this script
-------------------------------------------------

Preloading images
Posting this question here because I am not sure where this should belong.I am building an asp.net a

Struct/union and scope problem!
HI all , I have
Code: in header.h typedef struct Node Link; /* ---------

PEAR in appliactiond development
When I was picking up PHP I went from procedural programming, fairly quickly into OOP, then after wr

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