|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2000-07-21 16:09 UTC] andrei at cvs dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 07:00:01 2025 UTC |
sort() sorts strings numerically. The following program behaves differently on php4 (solaris) and php3 (linux): <? $a = array("0", "1", "2", "01", "02", "03", "23","044"); sort($a); while (list ($key, $value) = each ($a)) { echo "$key: $value\n"; } ?> php4.0.1.pl1 (on Solaris) results: 0: 0 1: 1 2: 01 3: 2 4: 02 5: 03 6: 23 7: 044 php3 (on Linux) results: 0: 0 1: 01 2: 02 3: 03 4: 044 5: 1 6: 2 7: 23