我想折叠一个多维数组,以便
$arr = array(
'first' => array(
'second' => array(
0 => 'foo',
1 => 'bar'
)
)
);
会崩溃到
$arr = array(
'first[second][0]' => 'foo',
'first[second][1]' => 'bar'
);
我想要做的是将multipart/form-data
$_POST
数组恢复到原始请求正文,如下所示:
------WebKitFormBoundaryxiOccKlMg4Al6VbH
Content-Disposition: form-data; name="first[second][0]"
foo
------WebKitFormBoundaryxiOccKlMg4Al6VbH
Content-Disposition: form-data; name="first[second][1]"
bar
------WebKitFormBoundaryxiOccKlMg4Al6VbH--