I'd like to collapse a multidimensional array so that
$arr = array(
'first' => array(
'second' => array(
0 => 'foo',
1 => 'bar'
)
)
);
would collapse to
$arr = array(
'first[second][0]' => 'foo',
'first[second][1]' => 'bar'
);
What I'm trying to do is to restore a multipart/form-data
$_POST
array to the original request body, like this:
------WebKitFormBoundaryxiOccKlMg4Al6VbH
Content-Disposition: form-data; name="first[second][0]"
foo
------WebKitFormBoundaryxiOccKlMg4Al6VbH
Content-Disposition: form-data; name="first[second][1]"
bar
------WebKitFormBoundaryxiOccKlMg4Al6VbH--