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

Change Age automatically
hi guys . im new to php , is it possible to change age value in mysql automatically when year change

Header is not working in IE
Hi ! header function is not working in IE but it works in FF, Safari, Chrome. any help please. :

preg_match logical error
Code: <?php
$s = file_get_contents("page.html");
preg_match('/<div cla

Really need helps regarding Pagination with Sort
I need someone helps regarding pagination problem...i actually want to make my page limited to let s

Coding question?
Hey guys, I have a quick question. If I want to make a way for people to pay for health in my game,

writing a screen scraper
Hello,

I'm writing a screen scraper application and want to be able to get absolute addresses

Save file by click
Hello.
I'm not understand how to save file from page. I'd like make link to file with save abil

newbie question
Hi out thereIm totaly new in this forum and to .net and vb so here is a totaly newbie question.I wan

Creating web pages by php
Hello again,
I was just wondering us there a way to use a php script to create a new web page. I

Save cookie to DB
I'm working on a pixel tracking script for an incentive website and I need to use an ASP script to s

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