I have one dynamic array, for example with following elements:
$myArray = array(1, 2, 3, 4, 5);
And I want my final array to be:
$finalArray = array(4, 1, 5, [whaterever]);
What's the best way to do custom sorting which is neither ascending or descending or doesn't follow any rule like this?
Thanks for your suggestions.
[Edit] I have edited my question.