I can't find anything on this- maybe because there isn't anything, but I figured someone would know:
I have an array with keys that have gaps in -
is there any way for me to reset the keys so that they stay in the same order?
I thought there was a sort function that didn't preserve keys, but the one that sorts by key preserves them with no option not to. if I have to, I'll write a function, but there's no point if I don't have to!
thanks
I have an array with keys that have gaps in -
Code:
key[0]
key[2]
key[4]
key[5]
is there any way for me to reset the keys so that they stay in the same order?
Code:
key[0]
key[1] //was key[2]
key[2] //was key[4]
key[3] //was key[5]
I thought there was a sort function that didn't preserve keys, but the one that sorts by key preserves them with no option not to. if I have to, I'll write a function, but there's no point if I don't have to!
thanks