I have and array here is an example
0 apples
1 oranges
2 peaches
3 pears
4 watermelon
What I am looking to do is something like this
0 apples
2 peaches
4 watermelon
1 oranges
3 pears
It does not matter if the array keys change or not, I just need the location of the values.
Output: