Re: sorting associative array

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




...



This won't work for me as I have 500+ records to sort based on the score key.. looking at jochem's class now. Thanks



which wont help much - assuming what you say is true (why wont it work? have you tried it).

sort method from the class:

    function sort()
    {
       if(count($this->sortKeys)) {
           usort($this->dataArray, array($this,"_sortcmp"));
       }
    }


Thanks jochem, I had a second look at it and I figured it out. I had problem implementing it with a class but now I have figured how to use it.

cheers,
Jeffery

ok, does that mean using usort() on your array works? my class is just a fancy wrapper around usort - and ofcourse it allows you to sort on more than 1 'column' in the second dimension of the array (kind of like a multi-column sort in an SQL statement). -- the point being that the usort() example Kurt (I think that was his name) sent would work also.

anyway glad you could use it. :-)

....

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux