Array Filter by Key
<?php
$list = [
'a' => 'A',
'b' => 'B',
'c' => 'C'
];
$selected = ['c', 'b'];
print_r(array_filter($list, function ($item) use ($selected) {
return in_array($item, $selected, true);
}, ARRAY_FILTER_USE_KEY));INFO