im fast approaching a deadline so any help would be great - sorry if this is an obvious question but i cant figure it out:
how do i sort an associative array based on the values and not the key/index value. i cant use the flip function because the values are not whole numbers and the key/index values are words.
any ideas?
URGENT array question
Moderator: General Moderators
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
First of all, your urgency is irrelevant. We treat every thread with the same priority so in the futur could you please choose your titles more appropriatly.
Secondly, take a look at http://ca.php.net/manual/en/function.arsort.php and its sisters.
Secondly, take a look at http://ca.php.net/manual/en/function.arsort.php and its sisters.
-
rubberjohn
- Forum Contributor
- Posts: 193
- Joined: Fri Feb 25, 2005 4:03 am
Obvious
first of all i meant that to mean that i dont have the time to look up what could potentially be a simple solution, not for you lot to drop what you are doing to help me
secondly, give me abit more credit i have already tried those, i dont just come across a problem and post a request for someone else to sort it
secondly, give me abit more credit i have already tried those, i dont just come across a problem and post a request for someone else to sort it
Re: Obvious
Did you try asort()rubberjohn wrote:secondly, give me abit more credit i have already tried those
http://ca.php.net/manual/en/function.asort.php
-
rubberjohn
- Forum Contributor
- Posts: 193
- Joined: Fri Feb 25, 2005 4:03 am
yup
yes i have tried that but with no success, is there some problem with arrays sort values that are floats?