我想在数组内推送另一个数组。这是我的数组。我想在textTabs上推送另一个数组。Array( [recipients] => Array ( [signers] => Array ( [0] => Array ( [email] => rm@gmail.com [tabs] => Array ( [checkboxTabs] => Array ( [0] => Array ( [tabLabel] => sampleCheckbox ) ) [textTabs] => Array ( [0] => Array ( [tabLabel] => CompanyName [value] => Qwerty ) [1] => Array ( [tabLabel] => TradingName [value] => Qwerty ) [2] => Array ( [tabLabel] => ContactName [value] => RM ) ) ) ) ) ))
1 回答
呼如林
TA贡献1798条经验 获得超3个赞
无需将 分配给 ,因为子数组被推送到初始数组本身。只需执行以下操作:array_push()
$data
array_push($array1['recipients']['signers']['0']['tabs']['textTabs'], $array2);print_r($array1);
我总是喜欢做这样的作业:
$array1['recipients']['signers']['0']['tabs']['textTabs'][] = $array2;
- 1 回答
- 0 关注
- 64 浏览
添加回答
举报
0/150
提交
取消