Voting

: four minus four?
(Example: nine)

The Note You're Voting On

nino at recgr dot com
8 years ago
array_column implementation that works on multidimensional arrays (not just 2-dimensional):

<?php
function array_column_recursive(array $haystack, $needle) {
$found = [];
array_walk_recursive($haystack, function($value, $key) use (&$found, $needle) {
if (
$key == $needle)
$found[] = $value;
});
return
$found;
}

Taken from https://github.com/NinoSkopac/array_column_recursive

<< Back to user notes page

To Top