I am running into an ordering issue after an arsort() -
Array
(
[22] => 20
[11] => 20
[17] => 18
[5] => 18
[35] => 17
[34] => 17
...
)
After I am done working with the first set of data, I need to use an array_shift(as far as I know, its the only way to delete/pop the top element). However this causes the indices to seemingly reset to their original order.
Array
(
[0] => 20
[1] => 18
[2] => 18
[3] => 17
[4] => 17
...
)
As you can see, the order of the values is retained, however the indices are reset. Is there any way to retain the original order of indices and values after performing a removal operation of the first element of the array? I am still a bit new to PHP so sorry if its an obvious solution.