Given the following array:
$data = [
'a' => 1,
'b' => 2,
'c' => 3
];
Is there a PHP function that, called this way:
x($data, ['a', 'c']);
Would return this result:
[
'a' => 1,
'c' => 3
]
Please note that I know how to write the code to generate the expected result, so please only answer if there is a native PHP function to do that, or alternatively to mention that there isn't, if you know this for a fact.