RE: Sorting multi-dimensional array

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

 



Re-write each array temporarily to a new array and sort that one. 

OR 

pull all counter values out into an array, sort that and then re-write the
entire old array to a new array based on counter value order.

-----Original Message-----
From: php-objects@xxxxxxxxxxxxxxx [mailto:php-objects@xxxxxxxxxxxxxxx] On
Behalf Of Francisco - São Paulo - Brazil
Sent: Saturday, July 01, 2006 9:14 AM
To: php-objects@xxxxxxxxxxxxxxx
Subject:  Sorting multi-dimensional array

I have this array:

Array
(
    [0] => Array
        (
            [account] => 263
            [counter] => 1
        )

    [1] => Array
        (
            [account] => 324
            [counter] => 5
        )

    [2] => Array
        (
            [account] => 972
            [counter] => 3
        )

    [3] => Array
        (
            [account] => 1316
            [counter] => 3
        )

    [4] => Array
        (
            [account] => 1380
            [counter] => 1
        )

    [5] => Array
        (
            [account] => 1880
            [counter] => 2
	)
)

I need to sort by the key [counter], how can I do that?




------------------------ Yahoo! Groups Sponsor --------------------~-->
Great things are happening at Yahoo! Groups.  See the new email design.
http://us.click.yahoo.com/TISQkA/hOaOAA/yQLSAA/saFolB/TM
--------------------------------------------------------------------~-> 

PHP Data object relational mapping generator http://www.metastorage.net/
Yahoo! Groups Links



 









PHP Data object relational mapping generator
http://www.metastorage.net/ 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-objects/

<*> To unsubscribe from this group, send an email to:
    php-objects-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 




[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux