I have an array of values, something like;
$array = array(1,2,3,4);
I want to be able to reposition an element and reorder.
Edit: To be clear on this point I don't just want to swop elements around, I want to move an element to a new place in the array and maintain the order of the other elements.
For example;
// move value 3 to index[1], result
$array(1,3,2,4);
// or move value 1 to index[3], result
$array[2,3,4,1);
To make it clearer if required;
$array('alice','bob','colin','dave');
// move value 'colin' to index[1], result
$array('alice','colin','bob','dave');
// or move value 'alice' to index[3], result
$array('bob','colin','dave', 'alice');
Any ideas please.