Hi,
I have an array with the following structure: char char integer.
I mean, when I print it get these example results:
POL LIPA 18
USA JOHNSON 21
FRA LIERRE 14
So, I would like this list to be sorted from the highest INT variable to the lowest, so I would get:
USA JOHNSON 21
POL LIPA 18
FRA LIERRE 14
I was able to use sort(); with arrays with the elements of same type but I think it wont work here?
Thanks for all help.
Sorting arrays with mixed elements
Moderator: General Moderators
- andyhoneycutt
- Forum Contributor
- Posts: 468
- Joined: Wed Aug 27, 2008 10:02 am
- Location: Idaho Falls
Re: Sorting arrays with mixed elements
This thread may help you out: viewtopic.php?f=1&t=117537
Re: Sorting arrays with mixed elements
Thanks mate, array_multisort() was exactly what I was looking for.
- andyhoneycutt
- Forum Contributor
- Posts: 468
- Joined: Wed Aug 27, 2008 10:02 am
- Location: Idaho Falls
Re: Sorting arrays with mixed elements
Excellent!