Last active
August 29, 2015 14:11
-
-
Save arioch1984/71841ed6c296675cefb3 to your computer and use it in GitHub Desktop.
max value from a column of associative array
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function array_col(array $a, $x) | |
{ | |
return array_map(function($a) use ($x) { return $a[$x]; }, $a); | |
} | |
$max = max(array_col($menu_items, 'colonna')); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment