Created
December 9, 2014 18:43
-
-
Save rhukster/bc448ff158df4bc56217 to your computer and use it in GitHub Desktop.
max_by()
This file contains 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
function max_by($array, $fieldname = null) | |
{ | |
$field_array = array(); | |
foreach ($array as $i => $befree) { | |
$field_array[$i] = $array[$i][$fieldname]; | |
} | |
return max($field_array); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment