Hi! Could we please enable some services and cookies to improve your experience and our website?
Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code
<?php
$arr1 = [
33 => [
0 => 30319,
1 => 30318,
2 => 30315
],
32 => [
0 => 21300,
1 => 45988
]
];
$arr2 = [
33 => [
0 => 50209,
1 => 50149
],
34 => [
0 => 12345
1 => 34567
]
];
foreach($arr1 as $k=>&$v) {
if(is_array($arr2[$k])) {
$v = array_merge($v, $arr2[$k]);
}
}
print_r($arr1);