I have an array like this:
array(
'sortBy' => array(0 => 3, 1 => 2, 2 => 1),
'other' => array(0 => 'x', 1 => 'y', 2 => 'z'),
'xxx' => array(0 => 3, 1 => 2, 2 => 1),
...
)
How can I sort contents of subarray other by values in sortBy ? There's unlimited amount of other subarrays inside that one array, but the keys inside these subarrays are always same(e.g. in sortBy, other, xxx the values of key 0 must all be sorted together)
Sorted array would look like this:
array(
'sortBy' => array(0 => 1, 1 => 2, 2 => 3),
'other' => array(0 => 'z', 1 => 'y', 2 => 'x'),
'xxx' => array(0 => 1, 1 => 2, 3 => 3)
)