note 30180 deleted from function.array-multisort by aidan
| From: | aidan@php.net | Date: | Sun, 03 Oct 2004 10:56:43 +0000 |
| Subject: | note 30180 deleted from function.array-multisort by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-77801@lists.php.net to get a copy of this message | ||
Note Submitter: moriarty {at} purely dot info
----
It should be noted that whilst the manuel says:
"It[array_multisort] maintains key association when sorting".
This is only Partially true.
It will maintain string keys and associates them properly.
However if you are using numeric keys, it will reset them to 0.
i.e.:
array(3) {
[10]=>
string(1) "a"
[11]=>
string(1) "e"
[2]=>
string(1) "b"
}
will become:
array(3) {
[0]=>
string(1) "a"
[1]=>
string(1) "b"
[2]=>
string(1) "c"
}
Although i'm not sure WHY this is the case, or why it's not documented in the manuel as
being the case.