Sorting entries

A

Anonymous

Guest
you can get the array of vals from SORT_NUMERIC to sort the array by date
here is an example from php.net
Code:
<?php

$fruits = array("lemon", "orange", "banana", "apple");
sort($fruits);
reset($fruits);
while (list($key, $val) = each($fruits)) {
   echo "fruits[" . $key . "] = " . $val . "\n";
}

?>
you can use sort_numeric to sort the date. itwill take you a little to sort a multidimesnsional array, there are some functions written on http://us2.php.net/manual/en/function.sort.php in the feedback section.
 
You'll be a lot better off if you just sort in your MySQL query using an ORDER BY clause.
 
Back
Top