考虑到我有一个这样的数组:
array:3 [▼
"description" => array:2 [▼
0 => "serv1"
1 => "serv2"
]
"quantity" => array:2 [▼
0 => "1"
1 => "2"
]
"cost" => array:2 [▼
0 => "100"
1 => "200"
]
]
来自如下所示的 HTML 表单:
<div class="col-md-6">
<div class="form-group">
<input
type="text"
name="service[description][]"
class="form-control"
/>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<input
type="text"
name="service[quantity][]"
class="form-control"
/>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<input
type="text"
name="service[cost][]"
class="form-control"
/>
</div>
</div>
我怎样才能以这样的方式修复数组,结果是这样的:
[
["description" => "serv1", "quantity" => "1", "cost" => "100"],
["description" => "serv2", "quantity" => "2", "cost" => "200"],
]
慕桂英546537
UYOU