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.
array_key_exists()? For example:true === array_key_exists('a', ['a' => 1]);. It only works for one key at a time though. ie2.php.net/array_key_exists