Multi Level Array Problem


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

hi all,

For example I have array like below:

$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

Google Wave
So... has anyone used it yet? Is it any good?

http://wave.google.com/help/wave/about.html#vid

Displaying image pathname instead of image
Hello

Im trying to upload and then display images from a mysql database - Its only basic and

ALV List display - header width adjust
Hi,

I am using REUSE_ALV_LIST_DISPLAY for my ALV display.The width of the ALV varies for

Comparing Values
Hi
I'm reading data from a database and this seems to work OK.

Each system has an associat

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

Echo-ing MySQL content and Keep Formatting?
I have data in my MySQL such as:

QuoteBlah blah

Blah blah

etc
but when i ech

foreach result into a single variable
Hi,

I have this code...

Code: [Select]foreach ($_POST['Interests'] as $interest =&

Can't shake the "Warning: include()" error
I've just uploaded my site to a new server and where I have PHP include tags in my HTML, the browser

Need Successful Return
Hello I am currently working a form here, and I have everything figured out except when I click the

Generate multilayered array from string.
ok so i have a string that looks like this:
Code: [Select]blog:edit_all,delete_all|users:edit_all

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