<?php
$array = [
'2' => [
'title' => 'Flower',
'order' => 3
],
'3' => [
'title' => 'Rock',
'order' => 1
],
'4' => [
'title' => 'Grass',
'order' => 2
]
];
$keys = array_keys($array);
array_multisort(
array_column($array, 'order'), SORT_DESC, SORT_NUMERIC, $array, $keys
);
$array = array_combine($keys, $array);
print_r($array);
preferences:
34.28 ms | 408 KiB | 5 Q