For example i have two arrays like:
$first_array = array(
1 => 'a',
2 => 'b',
3 => 'c',
4 => 'd',
5 => 'e'
);
$second_array = array(
1 => 'not important',
4 => 'not important',
3 => 'not important',
5 => 'not important',
2 => 'not important',
);
Is there any function that could arrange first array keys (with values) in sequence of second array keys? Or i just need to loop second array and recreate first by keys?
Update: Result values should be arranged by seconds arrays keys sequence
$result = array(
1 => 'a',
2 => 'd',
3 => 'c',
4 => 'e',
5 => 'b'
);