note 75346 deleted from function.ksort by nlopess
| From: | nlopess@php.net | Date: | Thu, 27 Dec 2007 14:42:20 +0000 |
| Subject: | note 75346 deleted from function.ksort by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-134040@lists.php.net to get a copy of this message | ||
Note Submitter: don dot hosek at gmail dot com
----
It's worth noting that ksort is also handy if you want to be able to do manipulations on an
numerically-keyed array which may not have been initialized in numerical order:
$a[2]=7;
$a[0]=1;
$a[1]=6;
foreach($a as $b) {
echo "$b ";
}
$a = ksort($a);
foreach($a as $b) {
echo "$b ";
}