Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== array_multisort ====== <code php> // $items is a keyed/associative array; each item has various key value // combinations as well, one of which is a date timestamp reset($items); foreach($items as $key=>&$item){ $sort[$key] = $item['datestamp']; } array_multisort($sort, SORT_DESC, $items); // $items is now sorted by date </code> The trick is knowing the key for the value you are sorting with, and putting the parameters in the correct order to array_multisort. If you don't have a keyed array, you just need to figure out the index number (0, 1, 2, etc...), since all arrays are really keyed in some fashion anyway. docs/programming/php/array_multisort.txt Last modified: 2011/03/23 10:14by billh