I have 2 arrays that I want to keep sequentially in sync after one has been re-sorted. E.G.:
$array1 = array(1, 2, 3, 4, 5);
$array2 = array(a, b, c, d, e);
[code acts on $array1 so that it becomes]:
$array1 = array(3, 1, 5, 4, 2);
I need code that gives this result:
$array2(c, a, e, d, b);
This is probably pretty simple using the keys for each, but the code that re-sorts $array1 is SQL (i.e. it is a field of data values that re-sorts via 'ORDER BY').
I'm not sure then how I would retain the original keys in $array1 so I could apply them to $array2.