[nav] => Array
(
[0] => Array
(
[id] => 2488
)
[1] => Array
(
[id] => 12
)
)
и второй массив
[2488] => Array
(
blablabla
)
[nav] => Array
(
[0] => Array
(
[id] => 2488
[2488] => Array ( blablabla )
)
[1] => Array
(
[id] => 12
)
)
$nav = array(
array( 'id' => 2488 ),
array( 'id' => 12 ),
);
$data = array(
'2488' => array( 'blablabla' ),
);
foreach ($nav as $k => $v) {
if (!empty($data[$v['id']])) {
$nav[$k][$v['id']] = $data[$v['id']];
}
}
var_dump($nav);