How to join lone elements of an array into the arrays within an array by order. Let's say I have the following array:
array:6 [
0 => array:2 [
"id" => 2
"type" => "studio_apartment"
]
1 => array:2 [
"id" => 3
"type" => "one_bedroom"
]
2 => array:2 [
"id" => 10
"type" => "two_bedroom"
]
3 => "20000"
4 => "30000"
5 => "40000"
]
Is it possible to get these lone elements in the array into the arrays above them? Such that the first lone element goes to the first array and so on. So that they can form something like this:
array:3 [
0 => array:2 [
"id" => 2
"type" => "studio_apartment"
"rent" => "20000"
]
1 => array:2 [
"id" => 3
"type" => "one_bedroom"
"rent" => "30000"
]
2 => array:2 [
"id" => 10
"type" => "two_bedroom"
"rent" => "40000"
]
]