<?php
$array = [
[
"configuration_id" => 10,
"id" => 1,
"optionNumber" => 3,
"optionActive" => 1,
"lastUpdated" => "2010-03-17 15:44:12"
],
[
"configuration_id" => 9,
"id" => 1,
"optionNumber" => 2,
"optionActive" => 1,
"lastUpdated" => "2010-03-17 15:44:12"
],
[
"configuration_id" => 8,
"id" => 1,
"optionNumber" => 1,
"optionActive" => 1,
"lastUpdated" => "2010-03-17 15:44:12"
]
];
array_multisort(
array_column($array, 'optionNumber'),
$array
);
var_export($array);
- Output for 7.4.0 - 7.4.33, 8.0.1 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
- 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:
98.1 ms | 403 KiB | 121 Q