mb_substr($str, 0, 200, 'UTF-8');
$word = array();
$max_bid = array();
for ($i = 0; $i < count($rr_word); $i++) {
$word[] = $rr_word[$i]['word'];
$max_bid[] = $rr_word[$i]['max_bid'];
}
array_multisort($word, SORT_ASC, $max_bid, SORT_DESC);
$word = array_unique($word);
$result = array();
foreach ($word as $key => $value) {
$result[] = array(
'word' => $value,
'max_bid' => $max_bid[$key],
);
}
Array
(
[0] => Array
(
[word] => автомобил
[max_bid] => 46
)
[1] => Array
(
[word] => продвижен
[max_bid] => 22
)
)