note 34159 added to function.uasort
| From: | php at eden2 dot com | Date: | Thu, 17 Jul 2003 09:36:37 +0000 |
| Subject: | note 34159 added to function.uasort | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-52262@lists.php.net to get a copy of this message | ||
Is it just me, or are the examples below misleading, and actually demonstrating situations that
would be more appropriate for usort()?
After trying to make sense of the uasort() description, it sounds like it's more for sorting a
1D array like this:
"john" => "$23.12"
"tim" => "$6.50"
"bob" => "$18.54"
and getting back:
"tim" => "$6.50"
"bob" => "$18.54"
"john" => $23.12"
(assuming, of course, that your sort function is lopping off the $ and evaluating as a number --
which would complicate the use of asort() ;)
----
Manual Page -- http://www.php.net/manual/en/function.uasort.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+34159
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+34159&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+34159&report=yes