Anyways, here is my problem I am hoping can be solved using built-in functionality as opposed to me writting all the sorting code by hand
I have any array which looks like this:
Code: Select all
Array
(
[0] => Array
(
[fname] => George
[lname] => Lucas
[time] => 1
)
[1] => Array
(
[fname] => Alexander
[lname] => Gallagher
[time] => 2
)
[2] => Array
(
[fname] => Matthew
[lname] => Black
[time] => 3
)
)Is there a way I can specify which column I want sorted using builtin array functions?
Heres the catch...if I sort by time in ascending order...I need the parent array indicies to change as well, so sorting the above array would return the same as above...but descending
Code: Select all
Matthew, Black, 3would become index ONE...
It appears as though I will need to write this manually from what I can tell by quickly glancing at the array sorting functions, they would just sort the columns and NOT reorder the parent array indicies, thus jumbling the data..???
Cheers