well a regular sort is accomplished with sort() this does NOT maintain correlations between value and key... ie:
1 => 7
2 => 3
sort() would return
1 => 3
2 => 7
to maintain the correlation (mainly for associative arrays) use asort() (links is in the post above) this results in..
1 => 7
2 => 3
sort() would return
2 => 3
1 => 7
to reverse sort... use rsort()
it would return..
1 => 3
2 => 7
sort() would return
1 => 7
2 => 3
and conversly, there is arsort() which is reverse sort while maintaining key associations
any one of these links will also have links to all the other sort options... read up on them, if none of those seem to do what you want, look into using usort()
Hope this all helps 🙂