Bug #16215 Updated: uasort does not seem to work
| From: | jeremy at titr dot uow dot edu dot au | Date: | Wed, 24 Apr 2002 00:17:31 +0000 |
| Subject: | Bug #16215 Updated: uasort does not seem to work | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-5754@lists.php.net to get a copy of this message | ||
ID: 16215
Updated by: jeremy@titr.uow.edu.au
Reported By: eved_hashem@lycos.com
Status: Feedback
Bug Type: Unknown/Other Function
Operating System: Unix
PHP Version: 4.1.2
New Comment:
same problem as mine (see number 16778).
To solve the problem pass your array by reference to the function
ex: uasort(&$array_to_be_sorted,"yourcmp")
Your array $array_to_be_sorted is now sorted ...
Don't expect any result returned by the function
(for me it returns 1, maybe saying the array has been sorted)
Previous Comments:
------------------------------------------------------------------------
[2002-03-22 03:58:51] mfischer@php.net
Please provide a full copy&paste example
------------------------------------------------------------------------
[2002-03-21 21:18:34] eved_hashem@lycos.com
I just want to report that the example code for the uasort function in
the PHP manual does not work and nothing gets sorted.. I've tried for
hours and using multiple books to get uasort to work with
multidimensional associative arrays and I have had no success... Am I
possibly printing out the arrays incorrectly?? This is what i Used to
display the sorted array in the example in the PHP manual:
for ( $row = 0; $row < 3; $row++ )
{
while (list($key, value) = each ($array[ $row] ) )
{
echo "|$value";
}
echo "|<BR>";
}
this can be the only possible thing I find that could be wrong.. if my
code is not incorrect than this is a bug in the program..
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=16215&edit=1