Get from associative array only that elements which keys are specified
- by hsz
Hello !
It's late and I know it is a very simple question but right now I do not have an idea and deadline is near..
I've got two arrays:
$array1 = array(
'a' => 'asdasd',
'b' => 'gtrgrtg',
'c' => 'fwefwefw',
'd' => 'trhrtgr',
);
$array2 = array(
'b', 'c'
);
What was the name of function to get a part of assoc array by keys from the second array ?
$result = array(
'b' => 'gtrgrtg',
'c' => 'fwefwefw',
);
Thanks !