<?php
$array = Array
(
0 => Array
(
'configuration_id' => 10,
'id' => 1,
'optionNumber' => 3,
'optionActive' => 1,
'lastUpdated' => '2010-03-17 15:44:12',
),
1 => Array
(
'configuration_id' => 9,
'id' => 1,
'optionNumber' => 2,
'optionActive' => 1,
'lastUpdated' => '2010-03-17 15:44:12',
),
2 => Array
(
'configuration_id' => 8,
'id' => 1,
'optionNumber' => 1,
'optionActive' => 1,
'lastUpdated' => '2010-03-17 15:44:12',
)
);
array_multisort(array_map(function($element) {
return $element['optionNumber'];
}, $array), SORT_ASC, $array);
print_r($array);
- Output for 5.4.45, 5.6.16, 7.1.0 - 7.1.33, 7.2.0 - 7.2.34, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.30, 8.2.0 - 8.2.25, 8.3.0 - 8.3.13
- Array
(
[0] => Array
(
[configuration_id] => 8
[id] => 1
[optionNumber] => 1
[optionActive] => 1
[lastUpdated] => 2010-03-17 15:44:12
)
[1] => Array
(
[configuration_id] => 9
[id] => 1
[optionNumber] => 2
[optionActive] => 1
[lastUpdated] => 2010-03-17 15:44:12
)
[2] => Array
(
[configuration_id] => 10
[id] => 1
[optionNumber] => 3
[optionActive] => 1
[lastUpdated] => 2010-03-17 15:44:12
)
)
preferences:
84.03 ms | 409 KiB | 5 Q