I have an array that looks like this:
Array
(
[0] => Item 0
[1] => Item 1
[2] => Item 2
)
Let’s say I wanted to move Item 1 to the end of the array and Item 2 to the top of the array (which would push Item 0 to the middle of the array.
How would I do that?
I tried using the unset and splice functions and it works sometimes but advanced movements like the one I talked about above parts of the array get deleted.
Try: