Q:

PHP - obtaining sub-array in a single expression

Is there a way to get, in a single expression, a sub-array from an array, giving specific keys from the original array?
By example:
$a = array('a' => 1, 'b' => 2, 'c' = 4, 'd' => 'clorch')
$b = doesthisfunctionexist($a, 'a', 'c')
//$b containing array('a' => 1, 'c' => 4)

I know I can code that function, but I'm asking if such a similar native function exists.

A:

$a = array(
  "a" => 1,
  "b" => 2,
  "c" => 4,
  "d" => "clorch",
);
$b = array_intersect_key($a, array_flip(array('a', 'c')));

