
andy7t
User
Sep 12, 2003, 12:42 PM
Post #1 of 5
(489 views)
|
|
Sorting Hashes
|
Can't Post
|
|
Hello, I'm making a Football game and the script at which i am stuck is the league generating script. OK, so here's my question. $team = "TEAMNAME"; $leaguepos= "LEAGUEPOSITION"; $hash{$team} = $leaguepos; OK, so how do i sort the $hash so that the $teams are sorted in order of there $leaguepos. E.G $hash{'Arsenal'} = "3"; $hash{'Man U'} = "1"; $hash{'Chelsea'} = "4"; $hash{'Newcastle'} = "2"; Would produce: Man U, Newcastle, Arsenal, Chelsea. Thanks.
|