note 39218 deleted from function.sort by mazzanet
| From: | mazzanet@php.net | Date: | Mon, 04 Jul 2005 10:38:49 +0000 |
| Subject: | note 39218 deleted from function.sort by mazzanet | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-91413@lists.php.net to get a copy of this message | ||
Note Submitter: metalwyrm at fastmail dot fm
----
because sort() is case sensitive, I made a function using
sort() that is case insensitive
function iSort($sortarr) {
$bakarr = $sortarr;
for($arrnum = 0; $arrnum < Count($sortarr); $arrnum++) {
$sortarr[$arrnum] = strtolower($sortarr[$arrnum])."|".$arrnum;
}
sort($sortarr);
reset($sortarr);
for($arrnum = 0; $arrnum < Count($sortarr); $arrnum++) {
$temp = explode("|", $sortarr[$arrnum]);
$newarr[] = $bakarr[$temp[Count($temp)-1]];
}
return $newarr;
}