Hello. You must sort the array in descending order using a specific key.
Code:
$result = array(); $i = 0; foreach($result as $value) { $result[$i]['example'] = $value; } $data = array(); foreach($result as $key => $value) { $data[$key] = $value['example']; } array_multisort($data, SORT_DESC, SORT_NUMERIC, $result); But, the fact is that it sorts by 1 or 2 digits, that is:
There are numbers: 9, 927, 99, 97. In sorted form it will look like this: 99, 97, 927, 9.
$resultarray, judging by your code, generally remains empty. By the way, what do you want to achieve with these metamorphoses? foreach ($ row as $ value) {$ row [$ i] ['example'] = $ value; } - Johny