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

Extracting URL pointer within XML tag
Hi.

I'm trying to extract text between two quotation marks in XML. For example, I want to ex

Just wondering what you think about my site
I am new to phpfreaks i just seen this form and thought it would be cool to see what other thought a

Links not updating
I'm trying to fuel a simple navigation system for a news section. It works fine when it comes to ret

form class help (oop php5)
Hidy Ho Neighbors,

I'm forcing myself to learn oop/classes for php5. It seems like a good id

PHP/Database issue
My friend is helping me make a database where you go to a certain webpage of my site and the page wi

Help on query replacing the date
Hi Pals,

i want to replace the current date in a column to some value say C or D or any n

writing a screen scraper
Hello,

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

Query failed issue with php script but works fine in mssql manager!
hi i have the script below which copies data from one table to another but will only insert new data

Update Database
Hi All,


I have a problem with this:

Code: [Select]<?php
session_start();

Agency Business Process
Hi,

I don’t understand the process of the agency business in SAP.

In my

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