Can PHP accept multidimensional arrays passed in the http request as form variables?
multidimensional arrays as form variables
(PHP 4.0 Beta 3 < )
Its really useful to be able to pass multidimensional arrays as form variables. So, I’m pleased to see that:
this is possible in PHP versions PHP 4.0 Beta 3 or later.
(I’m using version 5< but started using PHP in version 3. Since then I had found myself stuck in the habit of using the workarounds without realising that PHP had moved on.)
If you are running an older version of PHP you can still pass singularly-dimensional arrays. But to add the extra dimensions you will have to make your own system for referencing aspects of the form input name.
e.g the following input names could be converted into a multidimensional array within the receiving script:
myarray[keyarray1_value1]
myarray[keyarray1_value2]
myarray[keyarray2_value3]
myarray[keyarray2_value4]
See More info : http://uk3.php.net/manual/en/faq.html.php#faq.html.arrays
