Complex array sorting
am 27.11.2007 17:49:34 von cronetHi,
i want to do some sortings to a complex array.
The array structure is at the end of this message
Now I want the result sorted in that way:
SingleRoom ($hotel[0][Rooms][0][max_persons]) - lowest rate ($hotel[0]
[Rooms][0][overall])
or
DoubleRoom - lowest/highest rate
I have no clue how to solve this problem...
can those arrays be sorted with usort??
Regards,
alexander
[0] => Array
(
[Hotel] => Array
(
[id] => 9609
[name] => This is a test
[zip] => 86154
[created] => 2007-11-21 01:04:18
[modified] => 2007-11-24 14:18:57
)
[HotelDescriptions] => Array
(
[0] => Array
(
[id] => 104691
[descriptiontype_id] => 6
[hotel_id] => 12345
[description_de] => Test_de
[description_en] => Test_en
[created] => 2007-11-25 14:27:34
[modified] => 2007-11-25 14:27:37
)
)
[Rooms] => Array
(
[0] => Array
(
[hotel_id] => 12345
[room_id] => 1234508
[available] => 5
[roomtype] => 22
[max_persons] => 2
[rate_id] => 78431
[overall] => 168
)
[1] => Array
(
[hotel_id] => 12345
[room_id] => 1234507
[available] => 5
[roomtype] => 22
[max_persons] => 1
[rate_id] => 78431
[overall] => 116
)
[2] => Array
(
[hotel_id] => 12345
[room_id] => 1234505
[available] => 5
[roomtype] => 14
[max_persons] => 1
[rate_id] => 78431
[overall] => 103
)
[3] => Array
(
[hotel_id] => 12345
[room_id] => 1234506
[available] => 5
[roomtype] => 14
[max_persons] => 2
[rate_id] => 78431
[overall] => 148
)
[show] => 1
)
)
[1] => Array
(
[Hotel] => Array
(
[id] => 9610
[...]