|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2000-07-23 11:03 UTC] stas at cvs dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 13 03:00:02 2026 UTC |
sort an array and rsort an array should give the same order in reverse, the following does not: ------------ $a = array("0", "1", "01", "2"); sort($a); while (list ($key, $value) = each ($a)) { echo "$key: $value\n"; } echo "\n"; $a = array("0", "1", "01", "2"); rsort($a); while (list ($key, $value) = each ($a)) { echo "$key: $value\n"; } ------------ gives the results: 0: 0 1: 01 2: 1 3: 2 0: 2 1: 01 2: 1 3: 0