Loans - Facebook Proxy - The eBay Song - Bollywood Wallpapers - Loans

PDA

View Full Version : Array Problem


fireflyproject
Oct 16th 2007, 3:33 pm
I have an array:
menu_links = ['?page=home_content', ['?page=steaks_about', '?page=steaks_about', '?page=steaks_recipe', '?page=steaks_sauce'], ['?page=potatoes_about', '?page=potatoes_about', '?page=potatoes_recipe'], ['?page=asparagus_about', '?page=asparagus_about', '?page=asparagus_recipe'], '?page=feedback'];


Now, the way it looks to me, there are array's inside this array... how would one pull out seperate pieces of the inner ones? The way this array is set up is not something I have the ability to change, so I have to work with it this way. Any thoughts?

phper
Oct 17th 2007, 1:56 am
To make it easier for you to see, let me use a different content of the array and format slightly differently:

menu = [
'rice',
['spaghetti', 'fettuccine', 'penne'],
'noodles',
['water', 'orange juice', 'coke']
];

The contents of the array are:
menu[0] => 'rice'
menu[1] => the array ['spaghetti', 'fettuccine', 'penne']
menu[1][0] => 'spaghetti'
menu[1][1] => 'fettuccine'
menu[1][2] => 'penne'
menu[2] => 'noodles'
menu[3] => the array ['water', 'orange juice', 'coke']
menu[3][0] => 'water'
menu[3][1] => 'orange juice'
menu[3][2] => 'coke'

fireflyproject
Oct 17th 2007, 9:21 am
Oh! Thanks. I had no idea you could add the latter thing onto it. Thanks!