I have first array of ids:
$ids = [10,12,8];
And I have array of data:
$arr = [
12=>[
'content'=>'test1'
],
10=>[
'content'=>'test2'
],
8=>[
'content'=>'test3'
]
];
How can I sort array $arr
by $ids
values, so as result I need have this:
$arr = [
10=>[
'content'=>'test2'
],
12=>[
'content'=>'test1'
],
8=>[
'content'=>'test3'
]
];