我怎样才能得到这个:
(
[0] => Array
(
[name] => variation
[value] => variation1
)
[1] => Array
(
[name] => variationid
[value] => 70105
)
[2] => Array
(
[name] => fullName
[value] =>
)
[3] => Array
(
[name] => address
[value] =>
)
[4] => Array
(
[name] => country
[value] => usa
)
[5] => Array
(
[name] => state
[value] => Utah
)
看起来像这样:
$fields['variation']=>variation1[variationid]=>70105.. etc
我试过了:
foreach($_POST['fields'] as $key => $value){
$fields[$key] = $value;
}
我认为这应该可行,但它以完全相同的方式返回给我。这只是一个从 jquery 传递到 POST 的 serializedArray();我基本上只是希望能够使用 $fields['variation'] 访问来访问它。但这使它变得困难。