Voting

: max(one, five)?
(Example: nine)

The Note You're Voting On

kaspar dot wilbuer at web dot de
9 years ago
If you need to extract more than one column from an array, you can use array_intersect_key on each element, like so:

function array_column_multi(array $input, array $column_keys) {
$result = array();
$column_keys = array_flip($column_keys);
foreach($input as $key => $el) {
$result[$key] = array_intersect_key($el, $column_keys);
}
return $result;
}

<< Back to user notes page

To Top