How to Sort Arrays in PHP

Published Date Author: , Posted September 29th, 2009 at 2:21:37am

There are 4 “key” functions for dealing with PHP array sorting. These four have the significant feature of keeping the associated key/value relationships intact.

asort() – sort by value ascending
arsort()– sort by value descending

ksort()– sort by key ascending
krsort() – sort by key descending

For more information check out this php man page http://us3.php.net/manual/en/array.sorting.php

No comments as yet.

Leave Your Comment  Leave a comment

All fields marked with "*" are required.