foreach ($items as $x) {
foreach ($x as $y) {
$item[] = (array) $y;
}
}
The solution you have is the best because then you won't have conflicting keys if you use array_merge()
, and the time complexity is O(n)
which is pretty good.