I want to merge an array to another sub array. The code as below:
<?php
$data = array(
'id' => array(),
'data' => array(
'rows' => array(
array('name'=>'abc123'),
array('name'=>'abc456'),
array('name'=>'abc789'),
)
)
);
$temp = array(
array('name'=>'def123'),
array('name'=>'def456'),
array('name'=>'def789')
);
$data['data']['rows'] += $temp;
var_dump($data);
However it didn't work. I also try with array_merge but it is still the same. The only solution I can come up is using for-loop, but I don't want to use an addition for-loop.