SORT_NUMERIC
| From: | Jim Long | Date: | Fri, 28 Feb 2003 15:28:01 +0000 |
| Subject: | SORT_NUMERIC | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-137572@lists.php.net to get a copy of this message | ||
Hi,
Does anyone know how to make the flag "sort_numeric" work?
Will it work with asort?
asort ($numeric_array, SORT_NUMERIC);
I've tried this but it looks like it's having problems with the comma in
big numbers.
I'm not absolutely sure, but it looks like it's ignoring everything
after a comma when it sorts.
TIA,
Jim Long
BTW: asort is the one I need as I must maintain the keys
JanetVal Wrote:
> sort() sorts by value but assigns new keys as numbers.
> asort() sorts by value, but keeps the same keys
> ksort() sorts by key.
THANKS !
--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| Jim Long Network - Web Design |
| http://jimlong.net/web |
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| Jim Long - Rep: Manhattan Dance Orchestra |
| http://manhattandanceorchestra.com |
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-