$array1 = array(
array(
"id" => 123,
"title" => "aaa"),
array(
"id" => 456,
"title" => "bbb"),
array(
"id" => 789,
"title" => "ccc"),
array(
"id" => 101,
"title" => "ddd")
);
$array2 = array(123, 789);
$array2 = array(
array(
3 => 123),
array(
4 => 456)
);
$ids = array_map(function($n) {
return array_values($n)[0];
}, $array2);
$array1 = array_filter($array1, function($n) use($ids) {
return in_array($n['id'], $ids);
});
$result = array_filter($array1, function ($item) use ($array2) {
return in_array($item['id'], $array2);
});