Skip to content

Instantly share code, notes, and snippets.

@rhukster
Created December 9, 2014 18:43
Show Gist options
  • Save rhukster/bc448ff158df4bc56217 to your computer and use it in GitHub Desktop.
Save rhukster/bc448ff158df4bc56217 to your computer and use it in GitHub Desktop.
max_by()
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