Currently, I am using this function get indicies to collect the key/values from an array for an array of keys stored as values in another array:
function get_indicies($haystack,$needle_names = array()){
$needles = array();
foreach($needle_names as $needle_name){
if( isset($haystack[$needle_name]) ) $needles[$needle_name] = $haystack[$needle_name];
}
return $needles;
}
There are a ton of array functions in php, is there a way that I can, in class-scope, do this more efficiently, and user more of the built-in php functions?
This is often used under the name
pluckor similar as helper function.