I have a rather complicated issue that's probably related to array_splice
but I can't figure it out. Here's an example of the array I have:
array(
'a' => 'Element A',
'b' => 'Element B',
'c' => 'Element C',
'd' => 'Element D',
'e' => 'Element E'
);
What I want to do is reorder the array based on the key I select, say "c", such that the end result is:
array(
'c' => 'Element C',
'd' => 'Element D',
'e' => 'Element E',
'a' => 'Element A',
'b' => 'Element B'
);
It basically moves the selected key to the front, while keeping the ordering intact. Any help is greatly appreciated!