$groupMakesByWord = array();
foreach ($makes as $make) {
$groupMakesByWord[$make['word']][] = $make;
}
foreach ($groupMakesByWord as $makeWord => &$makes) {
uasort($makes, function($a, $b) {
if ($a['max_bid'] == $b['max_bid']) {
return 0;
}
return $a['max_bid'] < $b['max_bid'] ? 1 : -1;
});
}
unset($makes);
$result = array();
foreach ($groupMakesByWord as $makes) {
$result[] = current($makes);
}