![]() |
How can I sort a multidimensional array using php?
I have always done all my sorting of data within the sql query, however for once, i need to do it in php and since ive never done this in php, i'm a bit stumped, hoping someione can assist...
My array looks like this: PHP Code:
ORDER BY sc_ispd DESC, dateline DESC, groupid DESC I'm pretty sure i need to use array_multisort() to do this, but having some difficulty with it. Is it even possible to do what i am trying to do here? |
PHP Code:
|
Thanks - that worked for sorting on one criteria, however since i need to sort on multiple criteria, I had to dig around a bit but finally found a function on php.net with works for me and i'll post it here for others:
PHP Code:
$array = sc_sortarray($array, "sc_ispaid", DESC, "dateline", DESC, "groupid", DESC); |
All times are GMT. The time now is 02:45 PM. |
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:
|