how to sort by modification date?...
Posted: Mon Oct 11, 2004 11:04 pm
feyd | Help us, help you. Please use
I've tried all sorts of sort (rsort, arsort, krsort, etc.) but the list is never sorted by date. It seems to be sorting the elements of the date within each date, but not the dates themselves...
Thanks for your help, and please, note: I am new to php.
feyd | Help us, help you. Please use
Code: Select all
andCode: Select all
tags where approriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
Hi all
I'm trying to have the contents of a folder listed and sorted by last date they were modified.
I've got the list but can't figure out how to sort my items by date.
here's part of my code ($page is each item in the pages folder):Code: Select all
foreach($pages as $page){
$lm = date ('Y, m, g:i a', filemtime ("pages/$page"));
$time_array = explode (',', $lm);
ksort ($time_array);
$time_array = implode (',', $time_array);
print "<p>$time_array ($page)</p>";
}Thanks for your help, and please, note: I am new to php.
feyd | Help us, help you. Please use
Code: Select all
andCode: Select all
tags where approriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]