![]() |
Sorting arrays
I have this massive multikeyed array. I've loaded up arrays with the stats for various sites into $sites[$siteid], where $siteid is just a number to keep track of things. In there, I have set $sites[$siteid]["lastupdatetime"] for each (the time they were last updated, in seconds from 1970). I want to sort the various arrays in $sites[$siteid] by their respective values for $sites[$siteid]["lastupdatetime"], so I can just loop through $site[$siteid] and it'll be ordered right by date.
I'm kinda a PHP newbie (at least in some respects :D), so I've tried looking at the PHP documentation for sort() and its varients, but I'm baffled by how to sort my massive array in the way I want :(. Thanks in advance! |
Never mind... I finally found a solution in the comments in the PHP documentation for one of the sort functions.
I needed to use "usort", like so: PHP Code:
|
All times are GMT. The time now is 08:40 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|