I have two arrays First is
Array
(
[0] => Array
(
[image] => Copy1vs.jpg
[title] => V.S Achuthanandhan
[groupId] => 1
[masterId] => 1
[id] => 1
[itemId] => 1
[status] => 1
)
[1] => Array
(
[image] => Copy1pinarayi.jpg
[title] => Pinarayi Vijayan
[groupId] => 1
[masterId] => 2
[id] => 2
[itemId] => 2
[status] => 1
)
[2] => Array
(
[image] => Copy1chandy.jpg
[title] => Oommen Chandy
[groupId] => 1
[masterId] => 3
[id] => 3
[itemId] => 3
[status] => 1
)
)
And Second is
Array
(
[0] => Array
(
[image] => Copy1antony.jpg
[title] => A. K. Antony
[groupId] => 1
[masterId] => 4
[id] => 4
[itemId] => 4
[status] => 1
)
)
How can i combine these two arrays as a single array like
Array
(
[0] => Array
(
[image] => Copy1vs.jpg
[title] => V.S Achuthanandhan
[groupId] => 1
[masterId] => 1
[id] => 1
[itemId] => 1
[status] => 1
)
[1] => Array
(
[image] => Copy1pinarayi.jpg
[title] => Pinarayi Vijayan
[groupId] => 1
[masterId] => 2
[id] => 2
[itemId] => 2
[status] => 1
)
[2] => Array
(
[image] => Copy1chandy.jpg
[title] => Oommen Chandy
[groupId] => 1
[masterId] => 3
[id] => 3
[itemId] => 3
[status] => 1
)
[3] => Array
(
[image] => Copy1antony.jpg
[title] => A. K. Antony
[groupId] => 1
[masterId] => 4
[id] => 4
[itemId] => 4
[status] => 1
)
)
i tried array_merge method but not working as per my requirement is it possible without using a for loop..? these arrays gets from databse as
$itemListArray = array();
foreach($subcat as $sc){
$itemList = DB::table('votemasteritems')
->leftjoin('votemaster','votemaster.id','=','votemasteritems.masterId')
->leftjoin('items','items.id','=','votemasteritems.itemId')
->leftjoin('category','category.id','=','items.categoryId')
->select('items.image','votemaster.title','votemaster.groupId','votemaster.id as masterId','votemasteritems.*')
->where('votemaster.groupId',1)
->where('category.Id',$sc->id)
->get();
array_merge($itemListArray, $itemList);
}