|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[1999-11-10 02:49 UTC] thies at cvs dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 12:00:01 2025 UTC |
The following script : <?php $a[0] = 1; $a[r] = 2; $a[4] = 3; $a[c] = three; $a[d] = one; $a[a] = two; ?> Before being sorted ------------------- <?php reset($a); $b = current($a); while ($b != "") { echo "\$a[" . key($a) . "]=$b\n"; $b = next($a); } asort($a); ?> After being sorted ------------------- <?php reset($a); $b = current($a); while ($b != "") { echo "\$a[" . key($a) . "]=$b\n"; $b = next($a); } ?> gives the following output : Content-Type: text/html Before being sorted ------------------- $a[0]=1 $a[r]=2 $a[4]=3 $a[c]=three $a[d]=one $a[a]=two After being sorted ------------------- $a[d]=one $a[c]=three $a[a]=two $a[0]=1 $a[r]=2 $a[4]=3 While last week it produced (and so does php3 3.0.12) : Content-Type: text/html Before being sorted ------------------- $a[0]=1 $a[r]=2 $a[4]=3 $a[c]=three $a[d]=one $a[a]=two After being sorted ------------------- $a[0]=1 $a[r]=2 $a[4]=3 $a[d]=one $a[c]=three $a[a]=two Danny ---