3 ms·
I have to disagree also. The order inserted makes most sense in most cases. Hand crafting integer based array indexes out of order is rare. And as you say a si
by tylerjwilk00 7y ago
I have to disagree also.
The order inserted makes most sense in most cases. Hand crafting integer based array indexes out of order is rare. And as you say a simple ksort call guarantees sort order.
ksort($arr);
echo join($arr, ", ");
// one, two, three
- dpacmittal 7y agoExactly. Of you hand craft an array you probably need it in that order.
- tylerjwilk00 7y agoThen why not put it in order while you're hand crafting it?