Hi, first I want to thank those who helped me last time I posted, I have come a long way since then, much appreciated. Unfortunately I've run into a problem sorting some multidimensional arrays. Can you help?
I'll endeavor to make this as simple as possible.
1) I have a series of arrays, each one is represents the data on a house.
2) The arrays are multi-dimensional
3) Value number 86 (key number 86) of each array represents the house's price.
For instance here is some sample data:
house[0][86] = 215000 house[0][1] = "seattle"
house[1][86] = 180000 house[1][1] = "LA"
house[2][86] = 340000 house[2][1] = "chicago"
house[3][86] = 230000 house[3][1] = "boston"
That's the first house being $215, 000, second house $180,000, third is $340,000, fourth is $230,000.
With me so far?
So basically what I want to do is sort the houses and re-arrange all values based solely on ascending order of PRICE.
So a different way of saying this would be...I want the keys to remain the same, but I want the values of not only price but ALL OTHER VALUES to switch around based on the price of each house. Keep in mind I have a LOT of values, it's not just city and price, it's a ton of stuff, over 200 values in each array...but thankfully price is always number 86.
....after the sorting occurs I would like the array to look like this:
house[0][86] = 180000 house[0][1] = "LA"
house[1][86] = 215000 house[1][1] = "seattle"
house[2][86] = 230000 house[2][1] = "boston"
house[3][86] = 340000 house[3][1] = "chicago"
See what I'm trying to do?
Now I've explored sort() and so on but none of those functions seem to do what I want.
Suggestions? Thanks a lot!!!
PS. Please provide code examples if you can.