Multi Level Array Problem


Posted on 16th Feb 2014 07:03 pm by admin

hi all,

For example I have array like below:

Did you know?Explore Trending and Topic pages for more stories like this.
$temp = array(array('north america', 'us', 'california'), array('north america', 'us', 'hawaii'), array('north america', 'canada', 'vancouver'), array('asia', 'singapore', 'orchard');

I need to filter it out. So i hope the result could be:

array
'north america' =>
array
'us' =>
array 0 =>string 'california'
1 =>string 'hawai'
'asia' =>
array
'singapore'
array 0 => string 'orchard'



Anyone could help me to sorf out the logic? I just cannot solve this question.

Thanks
No comments posted yet

Your Answer:

Login to answer
109 Like 7 Dislike
Previous forums Next forums
Other forums

question about n
I was looking at some of the things you could do with php and one of the things I have tried is n.<

A little help needed passing hidden values to next page
I have a page that has hidden values in a form.

example
Code: <input name='signupID

path to include folder
Hi everyone,

When I'm testing locally, I have to add the name of the site folder as part of t

Parse Error with doctype
I'm getting a parse error with this simple code. I don't get it. It worked one time then when I relo

Removing Title From database problem
Hi again ! i am having an issue with updating database. When i update any price of a title it remove

explode() function problem maybe
Hi I'm having trouble searching my database. When I type two words in the search field it only searc

Tree Menu
Hi guys,

Can anyone help me making a tree navigation system? I have a site where I'm allowin

Adding Different Numbers From MySQL
Basically I have a mysql database with a couple prices as the following:

9.99
9.99
9.99

Uploading files/images via forms
Hey all, I am building a database for work that will contain some minor data on plant species along

Scene graph using Direct3D?
There are several C++ scene graph based packages available for OpenGl, like say OSG,

http://w

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