View Full Version : Resolved php array question

06-01-2009, 06:03 AM
hi ,

I am getting the array like this in php page

$arr = "menu[]=2&menu[]=4&menu[]=8"

Now i want to store it in database

How can i convert that array to

menu[0] = 2
menu[1] = 4
menu[2] = 8

so that i can store in database

06-01-2009, 06:19 AM
Do you mean that $menu should exist as an array?

$menu = array();

Done and done. That provides you with the $menu array, but I'm not 100% certain thats what you're looking to do.

06-01-2009, 07:06 AM
thanks for that ,

Actually there was error in posting.
I was storing all the arrays in one variable and then posting that variable but
actually i needed to post all the arrays at once

Thats why i was not receiving them properly