<?php
$array = [
'content_type' => [
'story',
'delhi',
'tez'
],
'type' => [
'video_id',
'subcategory',
'story_id'
],
'fetch_id' => [
32,
32,
2
],
'order' => [
6,
4,
5
],
'label' => [
'dsfs fdsf dsf sdf',
'dfsdfs',
'sdfsdfsd'
],
'link' => [
'fsd fsdf sdf',
'fsdfsdfdsf',
'fsdfdsfds'
],
'record' => [
10,
8,
12
]
];
$params[] = $array['order'];
foreach ($array as &$params[]);
array_multisort(...$params);
var_export($array);
- Output for 8.2.0 - 8.2.27, 8.3.0 - 8.3.16, 8.4.1 - 8.4.3
- array (
'content_type' =>
array (
0 => 'delhi',
1 => 'tez',
2 => 'story',
),
'type' =>
array (
0 => 'subcategory',
1 => 'story_id',
2 => 'video_id',
),
'fetch_id' =>
array (
0 => 32,
1 => 2,
2 => 32,
),
'order' =>
array (
0 => 4,
1 => 5,
2 => 6,
),
'label' =>
array (
0 => 'dfsdfs',
1 => 'sdfsdfsd',
2 => 'dsfs fdsf dsf sdf',
),
'link' =>
array (
0 => 'fsdfsdfdsf',
1 => 'fsdfdsfds',
2 => 'fsd fsdf sdf',
),
'record' =>
array (
0 => 8,
1 => 12,
2 => 10,
),
)
preferences:
49.02 ms | 408 KiB | 5 Q