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.
No comments posted yet

Your Answer:

Login to answer
185 Like 37 Dislike
Previous forums Next forums
Other forums

simplexml and xpath - Need some help
Hello,

I am trying to parse an xml which comes back from Amazon and I am trying to know how m

this code is not working????
it says this error.. Warning: Division by zero in ..

the variables are correct, so why is th

OOP help
okay so i have a class im making it has everything setup i just need to randomize the 2 variables an

Need help PLEASE
ok i have this warning showing up

Warning: in_array() [function.in-array]: Wrong datatype for

PHP Login
Hey!
I got this shopcart code online, am trying to modify it but am getting an error when i try a

Problem writing URL into database
How would I write this into the database?

<?php echo "http://".$_SERVER['SER

captcha error
I have been trying to implement a captcha in php...

here is the code..
Code: (php) [Select

Ignore html and bbcode?
I've created a function to limit the amount of text according to the amount of words.

However

Mysql query, two times?
Hello to all,

I'm new to php coding and i like it alot. I need help with some noob stuff.

'grab_files', multiple extension?
hey guys,

can anyone suggest a way to make to following line of code look for files with more

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