PHP - obtaining sub-array in a single expression -


is there way get, in single expression, sub-array array, giving specific keys 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 can code function, i'm asking if such similar native function exists.

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

Comments

Popular posts from this blog

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -

python 3.x - Mapping specific letters onto a list of words -